Ignore:
Timestamp:
Jul 26, 2006, 3:02:50 PM (15 years ago)
Author:
Eugene Romanenko
Message:

UI improvements, save files, ability to compile plugins with gcc, saveAs for djvu plugin, djvu plugin compiled with gcc, get rid of ddjvuapi.dll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/toolbar.cpp

    r87 r88  
    3737
    3838#include <stdio.h>
     39#include <string.h>
    3940#include <string>
    4041
     
    4748
    4849
    49 PFNWP pOldTbProc;
    50 
    51 
     50PFNWP pOldTbProc; // Old toolbar window proc
     51PFNWP pOldZeProc; // Old zoom entryfield window proc
     52
     53
     54// Toolbar window proc
    5255static MRESULT EXPENTRY tbProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
    5356{
     
    103106}
    104107
     108static char savedZeText[ 255 ] = "";
     109// Zoom entryfield window proc
     110static MRESULT EXPENTRY zeProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 )
     111{
     112    switch ( msg )
     113    {
     114        case WM_SETFOCUS:
     115        {
     116            char tmp[ 255 ] = "";
     117
     118            if ( SHORT1FROMMP( mp2 ) )
     119            {
     120                WinQueryWindowText( hwnd, sizeof( tmp ), tmp );
     121                if ( strlen( tmp ) > 0 ) {
     122                    strcpy( savedZeText, tmp );
     123                }
     124                WinSetWindowText( hwnd, "" );
     125            }
     126            else
     127            {
     128                WinQueryWindowText( hwnd, sizeof( tmp ), tmp );
     129                if ( strlen( tmp ) == 0 ) {
     130                    WinSetWindowText( hwnd, savedZeText );
     131                }
     132            }
     133        }
     134        break;
     135    }
     136    return pOldZeProc( hwnd, msg, mp1, mp2 );
     137}
     138
    105139
    106140HWND createToolbar( HWND hwnd )
     
    273307    WinSetPresParam( cs.ctrlHandle, PP_FONTNAMESIZE, deffontlen, deffont );
    274308    std::string actsizetext = getLocalizedString( TBHINT_ACTUAL_SIZE );
    275     setZoomValues( cs.ctrlHandle );
    276     cs.cx = 80;
     309    cs.cx = setZoomValues( cs.ctrlHandle ) +
     310                ( WinQuerySysValue( HWND_DESKTOP, SV_CXVSCROLL ) * 2 );
    277311    cs.cy = -100;
    278312    cs.bubbleText = NULL;
     313    pOldZeProc = WinSubclassWindow( WinWindowFromID( cs.ctrlHandle, CBID_EDIT ), zeProc );
    279314    WinSendMsg( hToolBar, TBM_ADDCONTROL, (MPARAM)&cs, MPVOID );
    280315
Note: See TracChangeset for help on using the changeset viewer.