Changeset 452 for trunk


Ignore:
Timestamp:
May 6, 2010, 8:01:24 AM (11 years ago)
Author:
Silvan Scherrer
Message:

ticket:198 set max textlength

Location:
trunk/Lucide/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/gui/findDlg.cpp

    r451 r452  
    3636
    3737#include <stdio.h>
     38#include <string.h>
    3839
    3940#include "globals.h"
     
    180181            WinSetDlgItemText( hwnd, IDC_PAGES, pgnum );
    181182
    182             // highlight the text
     183            // highlight the current page
    183184            WinSendDlgItemMsg( hwnd, IDC_PAGE, EM_SETSEL,
    184185                                      MPFROM2SHORT(0, 256), NULL);
     186            // set the maximum length for current page
     187            snprintf(pgnum, sizeof(pgnum), "%d", _this->pages);
     188            WinSendDlgItemMsg( hwnd, IDC_PAGE, EM_SETTEXTLIMIT,
     189                                      MPFROMSHORT((SHORT)strlen(pgnum)), NULL);
    185190
    186191            return (MRESULT)FALSE;
  • trunk/Lucide/gui/lucide.cpp

    r451 r452  
    224224    delete pgfrm;
    225225    WinSetDlgItemText( hToolBar, TBID_OFPAGES, pgnum );
     226
     227    // set the maximum length for current page
     228    snprintf(pgnum, sizeof(pgnum), "%d", pages);
     229    WinSendDlgItemMsg( hToolBar, TBID_PAGENUM, EM_SETTEXTLIMIT,
     230                              MPFROMSHORT((SHORT)strlen(pgnum)), NULL);
     231
    226232}
    227233
     
    240246    WinSendMsg( hToolBar, TBM_ENABLEITEM, MPFROMSHORT(CM_LASTPAGE), (MPARAM)enlast );
    241247
     248    // set actual page
    242249    bool tmp = dontSwitchPage;
    243250    dontSwitchPage = true;
Note: See TracChangeset for help on using the changeset viewer.