paragui-cvs
[Top][All Lists]
Advanced

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

[paragui-cvs] CVS: paragui/test listbox.cpp,1.1.2.1,1.1.2.2 paratest.cpp


From: Alexander Pipelka <address@hidden>
Subject: [paragui-cvs] CVS: paragui/test listbox.cpp,1.1.2.1,1.1.2.2 paratest.cpp,1.2.6.1,1.2.6.2
Date: Mon, 10 Jun 2002 12:44:09 -0400

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

Modified Files:
      Tag: devel-1-0
        listbox.cpp paratest.cpp 
Log Message:
final fix for deleting listboxitems within the callback handler
added SetAlignment for PG_RadioButton



Index: listbox.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/Attic/listbox.cpp,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -r1.1.2.1 -r1.1.2.2
*** listbox.cpp 2 May 2002 08:45:36 -0000       1.1.2.1
--- listbox.cpp 10 Jun 2002 16:44:07 -0000      1.1.2.2
***************
*** 5,10 ****
  
  PARAGUI_CALLBACK(handleListBoxItem) {
        PG_ListBoxItem* item = reinterpret_cast<PG_ListBoxItem*>(data);
!       delete item;
        return true;
  }
--- 5,22 ----
  
  PARAGUI_CALLBACK(handleListBoxItem) {
+       static int counter = 1;
+       char text[20];
+       
        PG_ListBoxItem* item = reinterpret_cast<PG_ListBoxItem*>(data);
!       PG_ListBox* list = item->GetParent();
!       
!       list->DeleteAll();
!       
!       for(int i=0; i<10; i++) {
!               sprintf(text,"NewItem %i", counter++);
!               list->AddItem(new PG_ListBoxItem(25, text));
!       }
! 
!       list->Update(); 
        return true;
  }

Index: paratest.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/test/paratest.cpp,v
retrieving revision 1.2.6.1
retrieving revision 1.2.6.2
diff -C2 -r1.2.6.1 -r1.2.6.2
*** paratest.cpp        28 May 2002 10:25:07 -0000      1.2.6.1
--- paratest.cpp        10 Jun 2002 16:44:07 -0000      1.2.6.2
***************
*** 342,351 ****
        wnd1.SetID(101);
        
-       //PG_Draw::DrawLine(0,0, app.GetScreenWidth()-1, 
app.GetScreenHeight()-1, color,1, app.GetScreen());
-       
        // create 2 radiobutton groups
        PG_RadioButton radio1(NULL, 1, PG_Rect(50,0,200,25), "RadioButton 1");
        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);
        
        PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");
--- 342,350 ----
        wnd1.SetID(101);
        
        // create 2 radiobutton groups
        PG_RadioButton radio1(NULL, 1, PG_Rect(50,0,200,25), "RadioButton 1");
        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);
+       radio1.SetAlignment(PG_TA_RIGHT);
        
        PG_RadioButton radio4(NULL, 4, PG_Rect(50,90,200,25), "RadioButton 4");




reply via email to

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