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/luutils.cpp

    r50 r88  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    442442}
    443443
    444 void setZoomValues( HWND lbox )
    445 {
    446     std::string actsizetext = getLocalizedString( TBHINT_ACTUAL_SIZE );
    447     WinSetWindowText( lbox, actsizetext.c_str() );
    448     WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END),
    449                 MPFROMP( actsizetext.c_str() ) );
    450     WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END),
    451                 MPFROMP( getLocalizedString( TBHINT_FIT_WINDOW ).c_str() ) );
    452     WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END),
    453                 MPFROMP( getLocalizedString( TBHINT_FIT_WIDTH ).c_str() ) );
     444SHORT setZoomValues( HWND lbox )
     445{
     446    char *actsizetext = newstrdupL( TBHINT_ACTUAL_SIZE );
     447    char *fitwindtext = newstrdupL( TBHINT_FIT_WINDOW );
     448    char *fitwidthtext = newstrdupL( TBHINT_FIT_WIDTH );
     449    WinSetWindowText( lbox, actsizetext );
     450    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( actsizetext ) );
     451    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( fitwindtext ) );
     452    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( fitwidthtext ) );
    454453    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "12.5%" ) );
    455454    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "25%" ) );
     
    463462    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "800%" ) );
    464463    WinSendMsg( lbox, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP( "1600%" ) );
     464
     465    HPS hps = WinGetPS( lbox );
     466    SHORT actsizelen = getStringPixSize( hps, actsizetext );
     467    SHORT fitwindlen = getStringPixSize( hps, fitwindtext );
     468    SHORT fitwidthlen = getStringPixSize( hps, fitwidthtext );
     469    WinReleasePS( hps );
     470
     471    delete fitwidthtext;
     472    delete fitwindtext;
     473    delete actsizetext;
     474
     475    return __max( actsizelen, __max( fitwindlen, fitwidthlen ) );
    465476}
    466477
    467478double convZoom( SHORT v )
    468479{
    469         double z = -3;
     480    double z = -3;
    470481    switch ( v )
    471482    {
Note: See TracChangeset for help on using the changeset viewer.