Modified windows.c window.prg

Modified windows.c window.prg

Postby xProgrammer » Sun Apr 06, 2008 8:37 pm

Hi Antonio

I have made the following additions

windows.c

Code: Select all  Expand view
HB_FUNC( GTKSETFGCOLOR )
{
   GdkColor color;

   gdk_color_parse( hb_parc( 2 ), &color );
   gtk_widget_modify_fg( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}
HB_FUNC( GTKSETBGCOLOR )
{
   GdkColor color;

   gdk_color_parse( hb_parc( 2 ), &color );
   gtk_widget_modify_bg( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}
HB_FUNC( GTKSETTEXTCOLOR )
{
   GdkColor color;

   gdk_color_parse( hb_parc( 2 ), &color );
   gtk_widget_modify_text( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}
HB_FUNC( GTKSETBASECOLOR )
{
   GdkColor color;

   gdk_color_parse( hb_parc( 2 ), &color );
   gtk_widget_modify_base( ( GtkWidget * ) hb_parnl( 1 ), hb_parni( 3 ), &color );
}
HB_FUNC( GTKRCPARSESTRING )
{
   gtk_rc_parse_string( hb_parc( 1 ) );
}


and in window.prg

Code: Select all  Expand view
   METHOD SetBackgroundColor( sCol, iState ) INLINE GtkSetBGColor( ::hWnd, sCol, iState )
   METHOD SetForegroundColor( sCol, iState ) INLINE GtkSetFGColor( ::hWnd, sCol, iState )
   METHOD SetTextColor( sCol, iState ) INLINE GtkSetTextColor( ::hWnd, sCol, iState )
   METHOD SetBaseColor( sCol, iState ) INLINE GtkSetBaseColor( ::hWnd, sCol, iState )
   METHOD SetEntrySelection( lSel ) INLINE GtkRCParseString( IF( lSel, "gtk-entry-select-on-focus = 1", "gtk-entry-select-on-focus = 0" ) )


The above changes give you control over the color of any window/dialog/control. Also includes the no entry-no-selection-on-entry option in a form that you can turn it on or off and with the underlying C code ready if we need to parse other strings. Whilst it doesn't have to be in any particular class, putting it in TWindow class makes it available in all the FiveLinux gui classes via inheritance.

Regards
Doug
(xProgrammer)
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 6 guests