paragui-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-cvs] CVS: paragui/test paratest.cpp,1.9.2.2,1.9.2.3


From: Teunis Peters <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test paratest.cpp,1.9.2.2,1.9.2.3
Date: Wed, 26 Jun 2002 12:25:02 -0400

Update of /cvsroot/paragui/paragui/test
In directory subversions:/tmp/cvs-serv28594/test

Modified Files:
      Tag: devel-opengl
        paratest.cpp 
Log Message:
More OpenGL work, and forgot key file!


Index: paratest.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/paratest.cpp,v
retrieving revision 1.9.2.2
retrieving revision 1.9.2.3
diff -C2 -r1.9.2.2 -r1.9.2.3
*** paratest.cpp        26 Jun 2002 03:25:04 -0000      1.9.2.2
--- paratest.cpp        26 Jun 2002 16:24:58 -0000      1.9.2.3
***************
*** 73,77 ****
        /** a new style callback member */
        bool handle_show_window(PG_Button* button) {
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
                Show(true);
                return true;
--- 73,76 ----
***************
*** 81,85 ****
        bool handle_slide_btntrans(PG_Slider* slider, long pos, PG_Pointer* 
data) {
                PG_Button* b = static_cast<PG_Button*>(data);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);              
                // set transparency of passed in button
                b->SetTransparency((Uint8)pos, (Uint8)pos, (Uint8)pos);
--- 80,83 ----
***************
*** 108,112 ****
  PG_Window(parent, r, windowtext, WF_SHOW_CLOSE | WF_SHOW_MINIMIZE)
  {
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        WidgetList = new PG_WidgetList(this, PG_Rect(30, 40, 220, 250));
        WidgetList->SetDirtyUpdate(false);
--- 106,109 ----
***************
*** 114,137 ****
        WidgetList->SetBackground("default/wnd_close.bmp", BKMODE_TILE, 0xFF);
        WidgetList->SetBackgroundBlend(0);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        WidgetList->EnableScrollBar(true, PG_SB_VERTICAL);
        WidgetList->EnableScrollBar(true, PG_SB_HORIZONTAL);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);              
        PG_Button* add = new PG_Button(this, 100, PG_Rect(260,130,110,30), "<< 
ADD");
        add->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_Button* remove = new PG_Button(this, 101, PG_Rect(260,165,110,30), 
">> REMOVE");
        remove->sigButtonClick.connect(slot(*this, &TestWindow::handleButton));
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_Button* b = new PG_Button(NULL, BTN_ID_YES, PG_Rect(0,0, 400,50), 
"YES");
        b->SetTransparency(128,128,128);
        b->SetFontName("qnx/font.ttf");
        WidgetList->AddWidget(b);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Slider* s = new PG_Slider(NULL, 20, PG_Rect(0, 0, 200,20), 
PG_SB_HORIZONTAL);
        s->SetRange(0,255);
        s->SetTransparency(200);
        s->SetPosition(50);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        s->sigSlide.connect(slot(*this, &TestWindow::handle_slide_btntrans), b);
  
--- 111,128 ----
***************
*** 168,177 ****
        drop->AddItem("Item 5");
        drop->AddItem("Item 6");
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
  }
  
  bool TestWindow::handleScrollPos(PG_ScrollBar* widget, long pos){
        int id = widget->GetID();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        if(id == 1){
                progress->SetProgress(pos);
--- 159,166 ----
***************
*** 190,194 ****
  bool TestWindow::handleScrollTrack(PG_ScrollBar* widget, long pos) {
        int id = widget->GetID();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        if(id == 1){
                progress->SetProgress(pos);
--- 179,182 ----
***************
*** 207,211 ****
  bool TestWindow::handleButton(PG_Button* widget) {
        static int label=0;
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        if(widget->GetID() == 100) {
                PG_Label* l = new PG_Label(NULL, PG_Rect(0,0,220,25), "");
--- 195,198 ----
***************
*** 345,349 ****
  
        PG_LogMSG("creating 'wnd' after %i ms", SDL_GetTicks() - start_ticks);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // create the testwindow
        TestWindow wnd(NULL, PG_Rect(100,100,500,300), "My first Testwindow");
--- 332,335 ----
***************
*** 353,362 ****
        
        PG_LogMSG("creating 'wnd1' after %i ms", SDL_GetTicks() - start_ticks);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        TestWindow wnd1(NULL, PG_Rect(50,50,500,300), "My 2nd Testwindow");
        wnd1.SetTransparency(0);
        wnd1.SetName("WindowTwo");
        wnd1.SetID(101);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        //PG_Draw::DrawLine(0,0, app.GetScreenWidth()-1, 
app.GetScreenHeight()-1, color,1, app.GetScreen());
        
--- 339,346 ----
***************
*** 365,381 ****
        PG_RadioButton radio2(NULL, 2, PG_Rect(50,25,200,25), "RadioButton 2", 
&radio1);
        PG_RadioButton radio3(NULL, 3, PG_Rect(50,50,200,25), "RadioButton 3", 
&radio1);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);      
        PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");
        PG_RadioButton radio5(NULL, 5, PG_Rect(50,115,200,25), "RadioButton 5", 
&radio4);
        PG_RadioButton radio6(NULL, 6, PG_Rect(50,140,200,25), "RadioButton 6", 
&radio4);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_CheckButton check1(NULL, 7, PG_Rect(300,140,180,25), "CheckButton 
1");
        PG_PopupMenu   popmenu(NULL, 425, 140, "My Menu");
        PG_PopupMenu   submenu(NULL, 425, 140, "My SubMenu");
        PG_PopupMenu   subsubmenu(NULL, 425, 140, "");
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        submenu.sigMenuItemSelect.connect(slot(handle_menu_click));
        subsubmenu.sigMenuItemSelect.connect(slot(handle_menu_click));
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        subsubmenu.addMenuItem("Mordor", 1).
            addMenuItem("Minas Morgul", 2).
--- 349,361 ----
***************
*** 386,390 ****
                addMenuItem("Hrothgar", 3).
          addMenuItem("Long ago", &subsubmenu);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
      popmenu.addMenuItem("Tasty", 1, slot(handle_menu_click)).
          addMenuItem("Even tastier", 2, slot(handle_menu_click)).
--- 366,369 ----
***************
*** 397,404 ****
      
        popmenu.disableItem(2);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_MenuBar menubar(NULL, PG_Rect(resx-300, 0, 300, 30));
        menubar.Add("PopMe 2", &popmenu);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_PopupMenu editmenu(NULL, 0 ,0, NULL);
        editmenu.addMenuItem("Cut", 1);
--- 376,381 ----
***************
*** 406,410 ****
        editmenu.addMenuItem("Paste", 3);
        menubar.Add("Edit", &editmenu);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        menubar.Show();
        
--- 383,386 ----
***************
*** 418,422 ****
  
        check1.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_ScrollBar scroll(NULL, 10, PG_Rect(50, 200, 300, 20), 
PG_SB_HORIZONTAL );
        scroll.Show();
--- 394,397 ----
***************
*** 426,450 ****
        edit.SetValidKeys("1234567890");
        edit.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // our new label with the callback member
        MySliderLabel slider_label(NULL, PG_Rect(360, 250, 50,20), "5");
        slider_label.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // create the slider
        PG_Slider slider(NULL, 11, PG_Rect(50, 250, 300,20), PG_SB_HORIZONTAL);
        slider.SetRange(5,20);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        // connect the "MSG_SLIDE" event with "handler_slider" of slider_label 
(see macro above, just for testing)
        slider.sigSlide.connect(slot(slider_label, 
&MySliderLabel::handle_slide));
        
        slider.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button popbtn(NULL, 20, PG_Rect(430, 250,100,25), "Pop me");
        popbtn.sigButtonClick.connect(slot(handle_popup), &popmenu);
        popbtn.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_SpinnerBox spin(NULL, PG_Rect(550,250,130,25));
        spin.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_DropDown drop(NULL, 14, PG_Rect(50, 280, 300,25));
        drop.SetIndent(5);
--- 401,419 ----
***************
*** 457,489 ****
        drop.AddItem("Item 6");
        drop.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button list(NULL, BTN_ID_OK, PG_Rect(400,450,100,30), "List");
        list.sigButtonClick.connect(slot(handle_list));
        list.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button quit(NULL, BTN_ID_CLOSE, PG_Rect(600,450,100,30), "Quit");
        quit.sigButtonClick.connect(slot(handle_exit));
        quit.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_Button show_wnd(NULL, BTN_ID_APPLY, PG_Rect(500,450,100,30), 
"Window");
        show_wnd.sigButtonClick.connect(slot(wnd, 
&TestWindow::handle_show_window));
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        show_wnd.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
          // show the testwindow
        wnd.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
          wnd1.Show();
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_LogMSG("app ready after %i ms", SDL_GetTicks() - start_ticks);
        app.ShowCursor(PG_CURSOR_SOFTWARE);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        PG_LogMSG("testing the widget finding methods");
        PG_Widget *tmp;
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        tmp = PG_Application::GetWidgetByName("WindowOne");
        if (tmp)
            PG_LogMSG("'WindowOne' found by name (id %d)", tmp->GetID());
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        tmp = PG_Application::GetWidgetById(100);
        if (tmp)
--- 426,448 ----
***************
*** 507,511 ****
            PG_LogMSG("sought for '1001' and found it (name '%s')",
                      tmp->GetName());
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
  
        if(!bTestMode) {
--- 466,469 ----
***************
*** 513,527 ****
            return EXIT_SUCCESS;
        }
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        start_ticks = SDL_GetTicks();
        int iter = 100;
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        for(int i=0; i<iter; i++) {
                PG_Widget::UpdateScreen();
        }
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        int ticks = SDL_GetTicks() - start_ticks;
        PG_LogMSG("did %i iterations in %i ms", iter, ticks);
- fprintf(stderr, "%s:%s:%i\n", __FILE__, __FUNCTION__, __LINE__);
        return EXIT_SUCCESS;    
  }
--- 471,481 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]