home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / Triton / Developer / DemoSource / toolmanager1.c < prev    next >
C/C++ Source or Header  |  1998-02-03  |  4KB  |  147 lines

  1. /*
  2.  *  OpenTriton -- A free release of the triton.library source code
  3.  *  Copyright (C) 1993-1998  Stefan Zeiger
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  *
  19.  *  Toolmanager1.c - Looks like the original ToolManager
  20.  *
  21.  */
  22.  
  23.  
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26. #include <string.h>
  27.  
  28. #include <libraries/triton.h>
  29.  
  30. #ifdef __GNUC__
  31. #ifndef __OPTIMIZE__
  32. #include <clib/triton_protos.h>
  33. #else
  34. #include <inline/triton.h>
  35. #endif /* __OPTIMIZE__ */
  36. #else
  37. #include <proto/triton.h>
  38. #endif /* __GNUC__ */
  39.  
  40.  
  41. STRPTR cycle_entries[]={"Exec","Image","Sound","Menu","Icon","Dock","Access",NULL};
  42.  
  43. extern struct List LVList;
  44.  
  45. struct Node LVNodes[] =
  46. {
  47.   { &LVNodes[1], (struct Node *)&LVList.lh_Head,  0, 0, "2024view" },
  48.   { &LVNodes[2], &LVNodes[0],                     0, 0, "Add to archive" },
  49.   { &LVNodes[3], &LVNodes[1],                     0, 0, "Delete" },
  50.   { &LVNodes[4], &LVNodes[2],                     0, 0, "Edit text" },
  51.   { &LVNodes[5], &LVNodes[3],                     0, 0, "Env" },
  52.   { &LVNodes[6], &LVNodes[4],                     0, 0, "Exchange" },
  53.   { &LVNodes[7], &LVNodes[5],                     0, 0, "Global Help System" },
  54.   { &LVNodes[8], &LVNodes[6],                     0, 0, "Multiview" },
  55.   { (struct Node *)&LVList.lh_Tail, &LVNodes[7],  0, 0, "Paint" }
  56. };
  57.  
  58. struct List LVList={&LVNodes[0],NULL,&LVNodes[8],0,0};
  59.  
  60.  
  61. int main(void)
  62. {
  63.   if(TR_OpenTriton(TRITON11VERSION,TRCA_Name,"ToolManagerGUIDemo1",TRCA_LongName,"ToolManager GUI demo 1",TRCA_Info,"Looks like the original ToolManager",TAG_END))
  64.   {
  65.     TR_AutoRequestTags(Application,NULL,
  66.       WindowID(0), WindowPosition(TRWP_BELOWTITLEBAR),
  67.       WindowTitle("ToolManager GUI demo 1"), WindowFlags(TRWF_NOSIZEGADGET|TRWF_NODELZIP|TRWF_NOZIPGADGET|TRWF_NOESCCLOSE),
  68.       WindowBackfillNone,
  69.  
  70.       VertGroupA,
  71.  
  72.         Space,
  73.  
  74.         HorizGroupAC,
  75.           Space,
  76.           TextID("_Object Type",1),
  77.           Space,
  78.           CycleGadget(cycle_entries,0,1),
  79.           Space,
  80.         EndGroup,
  81.  
  82.         Space,
  83.  
  84.         HorizGroupAC,
  85.           Space,
  86.             VertGroupAC,
  87.               CenteredTextID("Object List",2),
  88.               Space,
  89.               ListSSCN(&LVList,2,0,0),
  90.             EndGroup,
  91.           Space,
  92.             VertGroupA,
  93.               TextN(""),
  94.               Space,
  95.               Button("Top",3),
  96.               Space,
  97.               Button("Up",4),
  98.               Space,
  99.               Button("Down",5),
  100.               Space,
  101.               Button("Bottom",6),
  102.               Space,
  103.               Button("So_rt",7),
  104.             EndGroup,
  105.           Space,
  106.         EndGroup,
  107.  
  108.         Space,
  109.  
  110.         HorizGroupEA,
  111.           Space,
  112.           Button("_New...",8),
  113.           Space,
  114.           Button("_Edit...",9),
  115.           Space,
  116.           Button("Co_py",10),
  117.           Space,
  118.           Button("Remove",11),
  119.           Space,
  120.         EndGroup,
  121.  
  122.         Space,
  123.  
  124.         HorizGroupEA,
  125.           Space,
  126.           Button("_Save",12),
  127.           Space,
  128.           Button("_Use",13),
  129.           Space,
  130.           Button("_Test",14),
  131.           Space,
  132.           Button("_Cancel",15),
  133.           Space,
  134.         EndGroup,
  135.  
  136.         Space,
  137.  
  138.       EndGroup,
  139.  
  140.       TAG_END);
  141.     TR_CloseTriton();
  142.     return 0;
  143.   }
  144.   puts("Can't open triton.library v2+.");
  145.   return 20;
  146. }
  147.