NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorwaltspon
    • CommentTimeJun 25th 2018 edited
     
    Hello everyone;

    I would like to change the default orange color of button borders when mouse is over. Is it possible? if so, could someone share a piece of code?
    TIA
    Walter
    •  
      CommentAuthorwaltspon
    • CommentTimeJun 26th 2018
     
    No replies: does it mean it cannot be done or just that nobody is interested in my previous post?
    •  
      CommentAuthorxbasefan
    • CommentTimeJun 26th 2018 edited
     
    hi walter
    u should not confuse lack of responses with lack of interest. :wink:

    however, it appears to me that the official doc is crystal clear:
    "NTK OdBtnThemeSetProperty( <nPropID>, <nRgbColor> ) -> lSuccess
    Change the specified color property of the theme object used to draw NTK_BT_OWNERDRAW buttons."

    below the code snippet - copy/paste from the doc. rtfm!
    hth
    wilson
    // The following example shows how to turn the orginal
    // Orange theme into a brand new light Green theme .
    
    . . .
    
    // Button ’s Main Frame
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_MAIN_FRAME , NTK_RGB (020 ,113 ,130) )
    // Controling the Btn ’s highlighting when mouse over . This block modifies
    // the original orange slight edge to light green .
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_LEFT_FRAME1 , NTK_RGB (164 ,194 ,106) ) // Hilite 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_LEFT_FRAME2 , NTK_RGB (164 ,194 ,104) ) //
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_TOP_FRAME1 , NTK_RGB (172 ,201 ,120) ) // As 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_TOP_FRAME2 , NTK_RGB (180 ,205 ,131) ) // apps 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_RIGHT_FRAME1 , NTK_RGB (164 ,194 ,105) ) // defined 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_RIGHT_FRAME2 , NTK_RGB (164 ,195 ,114) ) // a SLIGHT 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_BOTTOM_FRAME1 , NTK_RGB (132 ,167 ,067) ) // is 
    NTK_OdBtnThemeSetProperty ( THM_BT_CLR_OVR_BOTTOM_FRAME2 , NTK_RGB (158 ,192 ,097) ) //
    
    // -- DEFINE THE APPLICATION TOOLBAR CONTAINER ...
    CREATE WINDOW hWndTB ;
    CLASS " ToolbarWindow32 " ;
    EXSTYLE WS_EX_TOPMOST ;
    STYLE WS_CHILD + WS_VISIBLE ;
    AT 0,0 SIZE aWndRect [ Rect_Right ], nTBHeight ;
    ON PAINT MainToolBarPaint () ;
    ID IDC_MAIN_TBAR ;
    INTO PARENT hWndP
    
    . . .
    
    // -- DEFINE TOOLBAR MEMBERS ( buttons )
    DECLARE TOOLBAR MEMBER INTO aTbBtnList ;
    ID ID_BTN_OPEN ;
    CAPTION "[O]"+CR+CR+"& Ouvrir ... " ;
    SUPER ACCEL KEY K_ALT_O ;
    ACTION Alert ( "Run   Open_DbDlg ()  proc ." ) ; // ACTION Open_DbDlg ( hWndP BITMAP UP " rOpen_up " ;
    BITMAP DN " rOpen_dn " ;
    BITMAP GRAYED " rOpen_off " ;
    BITMAP OVER " rOpen_ovr " ;
    SHIFT TO 6,6 ;
    BACKGROUND BRUSH hBtnBgBrush ;
    TOOLTIP " Ouvrir  une   table  de la  base  de  d o n n e s "+CR +;
    "(Alt +O )"
    
    . . .
    
    // -- MAKE THE APP TOOLBAR MENU USING THE PREVIOUS DECLARED MEMBERS ,
    // THEN CONNECT IT TO THE hWndTB CONTAINER ...
    @ 0.1 ,0.1 CREATE TOOLBAR FROM aTbBtnList ;
    INTO WINDOW hWndTB ;
    BUTTON HEIGHT 48 ;
    BUTTON WIDTH 52 ;
    BUTTON SPACING 00 ;
    BUTTON TYPE NTK_BT_OWNERDRAWN ;
    BUTTON STYLE BS_RIGHT ;
    BUTTON FONT NTK_GetStockObject ( ANSI_VAR_FONT )
    
    . . .
    
    
    •  
      CommentAuthorwaltspon
    • CommentTimeJun 28th 2018
     
    Hello Wilson,
    Many thanks for your help. You're right, I've finally found very good explanations about NTK_OdBtnTheme* functions and how to change button's style in NTKRad.pdf (p.172-175 chap. 0.58 Lo-level and Hi-level APIs/0.59 ButtonSystem). But, was not obvious for a novice! :confused:
    Quick question: I didn't find any definitions for THM_BT_CLR_* - Any idea?
    Walter