Re: [Plib-users] PUInput again
Brought to you by:
sjbaker
From: Steve W. <st...@sh...> - 2000-04-27 08:30:15
|
On Thu, 13 Apr 2000 22:30:03 -0500, Steve Baker wrote: >puInput was tested back when I first wrote it - I havn't used it >in any 'real' program since then - so I don't have any example >programs to share. Apologies for *my* delayed response... school and work have kept me a lot busier than I'd like... >As far as I know, it works OK - if you have a specific example >that doesn't, share it here on the list and we'll see what we >can see. Probably my biggest problems are knowing what keyboard function needs to be active, and how to get the input into my variables. An example to follow would be nice, but I'll show you what mine looks like right now... >BTW: There are many more people on the PLIB developer's list - you >might get better luck posting there. I guess I'll try that if no one here can help. Code follows: puDialogBox *dialog_box; puOneShot *dialog_box_ok_button, *dialog_box_cancel; puInput *field1, *field2, *field3; void close_conninfo_box(puObject *){ delete dialog_box_ok_button; delete dialog_box_cancel; delete dialog_box_title; delete field1; delete field2; delete field3; delete dialog_box; dialog_box=NULL; dialog_box_ok_button = dialog_box_cancel = NULL; dialog_box_title = NULL; field1=field2=field3=NULL; glutKeyboardFunc(Key); } int puiConnInfo(int numofargs,char *arg[], ConnInfo &PlyrConnInfo){ //test pui login stuff glutKeyboardFunc(puKey); dialog_box = new puDialogBox ( 100, 100 ) ; { new puFrame ( 0, 0, 400, 250 ) ; dialog_box_title = new puText( 10, 220 ) ; dialog_box_title->setLabelFont (PUFONT_HELVETICA_12) ; dialog_box_title->setLabel ("Connection Info") ; field1 = new puInput ( 20, 175, 270, 200 ); field1->setLabel ("Player Name"); field1->setDefaultValue("Player"); field1->setCallback(inputfield); field2 = new puInput ( 20, 125, 270, 150 ); field2->setLabel ("Server"); field2->setDefaultValue("localhost"); field3 = new puInput ( 20, 75, 270, 100 ); field3->setLabel ("Port Number"); field3->setDefaultValue(15000); dialog_box_ok_button = new puOneShot(100, 15, 150, 50); dialog_box_ok_button -> setLegend("OK"); //dialog_box_ok_button -> makeReturnDefault(TRUE); //dialog_box_ok_button -> setCallback(go_away_cb); dialog_box_cancel = new puOneShot(200, 15, 250, 50); dialog_box_cancel -> setLegend("Cancel"); //dialog_box_cancel -> makeReturnDefault(TRUE); dialog_box_cancel -> setCallback(close_conninfo_box); } dialog_box -> close () ; dialog_box -> reveal () ; return 0; } ----------- "Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws." - Plato (427-347 B.C.) |