Thread: [Plib-cvs] plib/src/pui pu.h,1.151,1.152 puComboBox.cxx,1.15,1.16 puObject.cxx,1.52,1.53 puSelectBox
Brought to you by:
sjbaker
From: John F. F. <fa...@us...> - 2005-11-10 20:21:31
|
Update of /cvsroot/plib/plib/src/pui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937 Modified Files: pu.h puComboBox.cxx puObject.cxx puSelectBox.cxx Log Message: Adding the new Edit Field colour to PUI widgets and extending the PUSTRING_MAX from 80 to 256 Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- pu.h 28 Aug 2005 06:25:15 -0000 1.151 +++ pu.h 10 Nov 2005 20:21:22 -0000 1.152 @@ -185,7 +185,8 @@ #define PUCOL_LABEL 3 #define PUCOL_LEGEND 4 #define PUCOL_MISC 5 -#define PUCOL_MAX 6 +#define PUCOL_EDITFIELD 6 +#define PUCOL_MAX 7 #define PUSLIDER_CLICK 0 #define PUSLIDER_ALWAYS 1 @@ -301,7 +302,7 @@ int isEmpty ( void ) const { return min[0]>max[0] || min[1]>max[1] ; } } ; -#define PUSTRING_MAX 80 +#define PUSTRING_MAX 256 /* With many memory managers, allocating powers of two is more efficient */ #define PUSTRING_INITIAL 64 @@ -790,13 +791,13 @@ int getStyle ( void ) const { return style ; } - void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; void setColorScheme ( float r, float g, float b, float a = 1.0f ) { setColourScheme ( r, g, b, a ) ; } - void setColour ( int which, float r, float g, float b, float a = 1.0f ) + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) { puSetColour ( colour [ which ], r, g, b, a ) ; puPostRefresh () ; @@ -1638,7 +1639,10 @@ { type |= PUCLASS_INPUT ; - setColourScheme ( 0.8f, 0.7f, 0.7f ) ; /* Yeukky Pink */ + setColourScheme ( colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; setColour ( PUCOL_MISC, 0.1f, 0.1f, 1.0f ) ; /* Colour of 'I' bar cursor */ widget = this ; @@ -2035,6 +2039,9 @@ int checkHit ( int button, int updown, int x, int y ) ; int checkKey ( int key, int updown ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puComboBox ( int minx, int miny, int maxx, int maxy, char **list, int editable = TRUE ) ; } ; @@ -2084,6 +2091,9 @@ void draw ( int dx, int dy ) ; int checkKey ( int key, int updown ) ; + virtual void setColourScheme ( float r, float g, float b, float a = 1.0f ) ; + virtual void setColour ( int which, float r, float g, float b, float a = 1.0f ) ; + puSelectBox ( int minx, int miny, int maxx, int maxy, char **list ) ; } ; Index: puComboBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puComboBox.cxx,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- puComboBox.cxx 23 Feb 2004 04:16:52 -0000 1.15 +++ puComboBox.cxx 10 Nov 2005 20:21:22 -0000 1.16 @@ -230,6 +230,24 @@ return TRUE ; } +void puComboBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puComboBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puComboBox::puComboBox ( int minx, int miny, int maxx, int maxy, char **entries, int editable ) : Index: puObject.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puObject.cxx,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- puObject.cxx 6 May 2005 18:46:34 -0000 1.52 +++ puObject.cxx 10 Nov 2005 20:21:22 -0000 1.53 @@ -39,7 +39,8 @@ { 0.7f, 0.7f, 0.7f, 1.0f }, /* PUCOL_HIGHLIGHT */ { 0.0f, 0.0f, 0.0f, 1.0f }, /* PUCOL_LABEL */ { 1.0f, 1.0f, 1.0f, 1.0f }, /* PUCOL_LEGEND */ - { 0.0f, 0.0f, 0.0f, 1.0f } /* PUCOL_MISC */ + { 0.0f, 0.0f, 0.0f, 1.0f }, /* PUCOL_MISC */ + { 0.8f, 0.7f, 0.7f, 1.0f } /* PUCOL_EDITFIELD */ } ; Index: puSelectBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puSelectBox.cxx,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- puSelectBox.cxx 23 Feb 2004 04:16:52 -0000 1.9 +++ puSelectBox.cxx 10 Nov 2005 20:21:22 -0000 1.10 @@ -147,6 +147,24 @@ return TRUE ; } +void puSelectBox::setColourScheme ( float r, float g, float b, float a ) +{ + puObject::setColourScheme ( r, g, b, a ) ; + setChildColourScheme( PUCLASS_INPUT, + colour [ PUCOL_EDITFIELD ][0], + colour [ PUCOL_EDITFIELD ][1], + colour [ PUCOL_EDITFIELD ][2], + colour [ PUCOL_EDITFIELD ][3] ) ; +} + +void puSelectBox::setColour ( int which, float r, float g, float b, float a ) +{ + if (which == PUCOL_EDITFIELD) + input->setColourScheme ( r, g, b, a ) ; + else + puObject::setColour ( which, r, g, b, a ) ; +} + puSelectBox::puSelectBox ( int minx, int miny, int maxx, int maxy, char **entries ) : |