home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / CIT.v4 / Demo / ListBrowserTest.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  1.4 KB  |  69 lines

  1. #include <CITGroup.h>
  2. #include <CITButton.h>
  3. #include <CITListBrowser.h>
  4.  
  5. #include <stdlib.h>
  6.  
  7. char* text[] = {"Line 1","Line 2","Long line 3","Line 4","Line 5",NULL};
  8.  
  9. ColumnInfo ci[] = { {25,"Col 1",0} , {-1,STRPTR(~0L),-1} };
  10.  
  11. CITApp Application;
  12.  
  13. CITWorkbench   DemoScreen;
  14. CITWindow      DemoWindow;
  15. CITVGroup      winGroup;
  16. CITListBrowser lb;
  17. CITButton      quitButton;
  18.  
  19. void CloseEvent();
  20. void QuitEvent(ULONG ID);
  21. BOOL makeNodes(CITList& list,char** label);
  22. void freeNodes(CITList& list);
  23.  
  24. int main(void)
  25. {
  26.   BOOL Error=FALSE;
  27.  
  28.   DemoScreen.InsObject(DemoWindow,Error);
  29.     DemoWindow.Position(WPOS_CENTERSCREEN);
  30.     DemoWindow.CloseGadget();
  31.     DemoWindow.DragBar();
  32.     DemoWindow.SizeGadget();
  33.     DemoWindow.DepthGadget();
  34.     DemoWindow.IconifyGadget();
  35.     DemoWindow.Activate();
  36.     DemoWindow.Caption("CITListBrowser Test");
  37.     DemoWindow.CloseEventHandler(CloseEvent);
  38.     DemoWindow.InsObject(winGroup,Error);
  39.       winGroup.SpaceOuter();
  40.       winGroup.InsObject(lb,Error);
  41.         lb.MinWidth(100);
  42.         lb.Labels(text);
  43.         lb.ColumnInfo(ci);
  44.       winGroup.InsObject(quitButton,Error);
  45.         quitButton.Text("Quit");
  46.         quitButton.MaxHeight(20);
  47.         quitButton.EventHandler(QuitEvent);
  48.  
  49.   Application.InsObject(DemoScreen,Error);
  50.  
  51.   // Ok?
  52.   if( Error )
  53.     return 10;
  54.  
  55.   Application.Run();
  56.  
  57.   return 0;
  58. }
  59.  
  60. void QuitEvent(ULONG ID)
  61. {
  62.   Application.Stop();
  63. }
  64.  
  65. void CloseEvent()
  66. {
  67.   Application.Stop();
  68. }
  69.