/[paragui]/paragui/test/paratest.cpp
ViewVC logotype

Diff of /paragui/test/paratest.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.6.11.2.2 by braindead, Mon Nov 24 09:17:22 2003 UTC revision 1.2.6.11.2.3 by braindead, Tue Dec 2 15:27:59 2003 UTC
# Line 19  Line 19 
19  #include "pgspinnerbox.h"  #include "pgspinnerbox.h"
20  #include "pglog.h"  #include "pglog.h"
21  #include "pgmenubar.h"  #include "pgmenubar.h"
22    #include "pgtheme.h"
23    
24    #include <iostream>
25    
26  #define RESX 800  #define RESX 800
27  #define RESY 600  #define RESY 600
# Line 28  void Splash() { Line 31  void Splash() {
31      PG_ThemeWidget splash1(&splash, PG_Rect(10,10,580,380));      PG_ThemeWidget splash1(&splash, PG_Rect(10,10,580,380));
32      PG_ThemeWidget splash2(&splash1, PG_Rect(10,10,560,340));      PG_ThemeWidget splash2(&splash1, PG_Rect(10,10,560,340));
33      PG_Label l(&splash2, PG_Rect(10,10,540,320), "I'm a splash screen");      PG_Label l(&splash2, PG_Rect(10,10,540,320), "I'm a splash screen");
34      l.SetAlignment(PG_TA_CENTER);      l.SetAlignment(PG_Label::CENTER);
35                    
36      splash.Show();      splash.Show();
37      SDL_Delay(5000);      SDL_Delay(5000);
# Line 104  private: Line 107  private:
107                    
108    
109  TestWindow::TestWindow(PG_Widget* parent, const PG_Rect& r, char* windowtext) :  TestWindow::TestWindow(PG_Widget* parent, const PG_Rect& r, char* windowtext) :
110  PG_Window(parent, r, windowtext, WF_SHOW_CLOSE | WF_SHOW_MINIMIZE)  PG_Window(parent, r, windowtext, DEFAULT)
111  {  {
112          WidgetList = new PG_WidgetList(this, PG_Rect(30, 40, 220, 250));          WidgetList = new PG_WidgetList(this, PG_Rect(30, 40, 220, 250));
113          WidgetList->SetDirtyUpdate(false);          WidgetList->SetDirtyUpdate(false);
# Line 112  PG_Window(parent, r, windowtext, WF_SHOW Line 115  PG_Window(parent, r, windowtext, WF_SHOW
115          WidgetList->SetBackground("default/wnd_close.bmp", BKMODE_TILE, 0xFF);          WidgetList->SetBackground("default/wnd_close.bmp", BKMODE_TILE, 0xFF);
116          WidgetList->SetBackgroundBlend(0);          WidgetList->SetBackgroundBlend(0);
117                                                    
118          WidgetList->EnableScrollBar(true, PG_SB_VERTICAL);          WidgetList->EnableScrollBar(true, PG_ScrollBar::VERTICAL);
119          WidgetList->EnableScrollBar(true, PG_SB_HORIZONTAL);          WidgetList->EnableScrollBar(true, PG_ScrollBar::HORIZONTAL);
120                                    
121          (new PG_Button(this, 100, PG_Rect(260,130,110,30), "<< ADD"))->sigClick.connect(slot(*this, &TestWindow::handleButtonClick));          (new PG_Button(this, 100, PG_Rect(260,130,110,30), "<< ADD"))->sigClick.connect(slot(*this, &TestWindow::handleButtonClick));
122                    
# Line 124  PG_Window(parent, r, windowtext, WF_SHOW Line 127  PG_Window(parent, r, windowtext, WF_SHOW
127          b->SetFontName("qnx/font.ttf");          b->SetFontName("qnx/font.ttf");
128          WidgetList->AddWidget(b);          WidgetList->AddWidget(b);
129    
130          PG_Slider* s = new PG_Slider(NULL, 20, PG_Rect(0, 0, 200,20), PG_SB_HORIZONTAL);          PG_Slider* s = new PG_Slider(NULL, 20, PG_Rect(0, 0, 200,20), PG_ScrollBar::HORIZONTAL);
131          s->SetRange(0,255);          s->SetRange(0,255);
132          s->SetTransparency(200);          s->SetTransparency(200);
133          s->SetPosition(50);          s->SetPosition(50);
# Line 206  bool TestWindow::handleButtonClick(PG_Bu Line 209  bool TestWindow::handleButtonClick(PG_Bu
209    
210          if(id == 100) {          if(id == 100) {
211                  PG_Label* l = new PG_Label(NULL, PG_Rect(0,0,220,25), "");                  PG_Label* l = new PG_Label(NULL, PG_Rect(0,0,220,25), "");
212                  l->SetAlignment(PG_TA_CENTER);                  l->SetAlignment(PG_Label::CENTER);
213                  l->SetTextFormat("Label %i", ++label);                  l->SetTextFormat("Label %i", ++label);
214                  WidgetList->AddWidget(l);                  WidgetList->AddWidget(l);
215                    
# Line 360  int main(int argc, char* argv[]) { Line 363  int main(int argc, char* argv[]) {
363          PG_RadioButton radio1(NULL, 1, PG_Rect(50,0,200,25), "RadioButton 1");          PG_RadioButton radio1(NULL, 1, PG_Rect(50,0,200,25), "RadioButton 1");
364          PG_RadioButton radio2(NULL, 2, PG_Rect(50,25,200,25), "RadioButton 2", &radio1);          PG_RadioButton radio2(NULL, 2, PG_Rect(50,25,200,25), "RadioButton 2", &radio1);
365          PG_RadioButton radio3(NULL, 3, PG_Rect(50,50,200,25), "RadioButton 3", &radio1);          PG_RadioButton radio3(NULL, 3, PG_Rect(50,50,200,25), "RadioButton 3", &radio1);
366          radio1.SetAlignment(PG_TA_RIGHT);          radio1.SetAlignment(PG_Label::RIGHT);
367                    
368          PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");          PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");
369          PG_RadioButton radio5(NULL, 5, PG_Rect(50,115,200,25), "RadioButton 5", &radio4);          PG_RadioButton radio5(NULL, 5, PG_Rect(50,115,200,25), "RadioButton 5", &radio4);
# Line 415  int main(int argc, char* argv[]) { Line 418  int main(int argc, char* argv[]) {
418    
419          check1.Show();          check1.Show();
420    
421          PG_ScrollBar scroll(NULL, 10, PG_Rect(50, 200, 300, 20), PG_SB_HORIZONTAL );          PG_ScrollBar scroll(NULL, 10, PG_Rect(50, 200, 300, 20), PG_ScrollBar::HORIZONTAL );
422          scroll.Show();          scroll.Show();
423    
424          PG_MaskEdit edit(NULL, PG_Rect(260,0,200,25));          PG_MaskEdit edit(NULL, PG_Rect(260,0,200,25));
# Line 428  int main(int argc, char* argv[]) { Line 431  int main(int argc, char* argv[]) {
431          slider_label.Show();          slider_label.Show();
432    
433          // create the slider          // create the slider
434          PG_Slider slider(NULL, 11, PG_Rect(50, 250, 300,20), PG_SB_HORIZONTAL);          PG_Slider slider(NULL, 11, PG_Rect(50, 250, 300,20), PG_ScrollBar::HORIZONTAL);
435          slider.SetRange(5,20);          slider.SetRange(5,20);
436          //slider.SetTransparency(128);          //slider.SetTransparency(128);
437    
# Line 476  int main(int argc, char* argv[]) { Line 479  int main(int argc, char* argv[]) {
479          wnd1.Show();          wnd1.Show();
480                    
481          PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);          PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
482          app.ShowCursor(PG_CURSOR_SOFTWARE);          app.ShowCursor(PG_Application::SOFTWARE);
483    
484          PG_LogMSG("testing the widget finding methods");          PG_LogMSG("testing the widget finding methods");
485          PG_Widget *tmp;          PG_Widget *tmp;

Legend:
Removed from v.1.2.6.11.2.2  
changed lines
  Added in v.1.2.6.11.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26