Update of /cvsroot/plib/plib/src/puAux
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6036
Modified Files:
puAux.h puAuxComboBox.cxx puAuxSelectBox.cxx
Log Message:
More widget colors. I'm not really sure, since I'm not really John Fay. Forgive me!
Index: puAux.h
===================================================================
RCS file: /cvsroot/plib/plib/src/puAux/puAux.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- puAux.h 6 May 2005 19:04:32 -0000 1.7
+++ puAux.h 10 Nov 2005 20:07:08 -0000 1.8
@@ -277,6 +277,9 @@
int getCallbackSource ( void ) const { return callback_source ; }
+ 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 ) ;
+
puaComboBox ( int minx, int miny, int maxx, int maxy,
char **list, int editable = TRUE ) ;
@@ -358,6 +361,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 ) ;
+
puaSelectBox ( int minx, int miny, int maxx, int maxy,
char **list ) ;
} ;
@@ -866,6 +872,14 @@
* A scrolling list for PUI.
*
* Believe it or not, PUI does not have one of these.
+ *
+ * This widget consists of a puListBox, a slider and two
+ * arrow buttons. This makes the ListBox scrollable,
+ * very handy if the box is too small to show all items
+ * at once.
+ *
+ * (Original code taken from FlightGear 0.9.6 sources,
+ * modified by Jan Reucker)
*/
class puaList : public puGroup
{
@@ -877,19 +891,32 @@
puSlider * _slider;
puArrowButton * _up_arrow;
puArrowButton * _down_arrow;
+ int _style;
protected:
- virtual void init (int w, int h);
+ virtual void init (int w, int h, short transparent);
public:
puaList (int x, int y, int w, int h);
puaList (int x, int y, int w, int h, char ** contents);
+ puaList (int x, int y, int w, int h, short transparent);
+ puaList (int x, int y, int w, int h, short transparent, char ** contents);
virtual ~puaList ();
virtual void newList (char ** contents);
- // TODO: other string value funcs
virtual char * getListStringValue ();
virtual int getListIntegerValue();
+
+ virtual char * getStringValue ();
+ virtual int getIntegerValue ();
+ virtual void getValue (char **ps);
+ virtual void getValue (int *i);
+
+ virtual void setStyle (int style);
+
+ int getNumItems ( void ) const ;
+ int getTopItem ( void ) const ;
+ void setTopItem ( int item_index );
};
#endif
Index: puAuxComboBox.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/puAux/puAuxComboBox.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- puAuxComboBox.cxx 6 May 2005 19:04:32 -0000 1.5
+++ puAuxComboBox.cxx 10 Nov 2005 20:07:08 -0000 1.6
@@ -304,6 +304,24 @@
return TRUE ;
}
+void puaComboBox::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 puaComboBox::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 ) ;
+}
+
puaComboBox::puaComboBox ( int minx, int miny, int maxx, int maxy,
char **entries, int editable ) :
Index: puAuxSelectBox.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/puAux/puAuxSelectBox.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- puAuxSelectBox.cxx 21 Mar 2004 19:03:23 -0000 1.3
+++ puAuxSelectBox.cxx 10 Nov 2005 20:07:08 -0000 1.4
@@ -148,6 +148,24 @@
return TRUE ;
}
+void puaSelectBox::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 puaSelectBox::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 ) ;
+}
+
puaSelectBox::puaSelectBox ( int minx, int miny, int maxx, int maxy,
char **entries ) :
|