home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / Triton / Source / demos / toolmanager2.c < prev    next >
C/C++ Source or Header  |  1998-05-23  |  4KB  |  152 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.  *  Toolmanager2.c - Looks like the ToolManager demo 2 of GUIFront
  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,"ToolManagerGUIDemo2",TRCA_LongName,"ToolManager GUI demo 2",TRCA_Info,"Looks like the ToolManager demo 2 of GUIFront",TAG_END))
  64.   {
  65.     TR_AutoRequestTags(Application,NULL,
  66.       WindowID(0), WindowPosition(TRWP_MOUSEPOINTER),
  67.       WindowTitle("ToolManager GUI demo 2"), WindowFlags(TRWF_NOSIZEGADGET|TRWF_NODELZIP|TRWF_ZIPTOCURRENTPOS),
  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.         HorizGroup,
  85.           Space,
  86.           NamedFrameBox("Object List"),
  87.             HorizGroupAC,
  88.               Space,
  89.               VertGroupA,
  90.                 Space,
  91.                 ListSSCN(&LVList,2,0,0),
  92.                 Space,
  93.               EndGroup,
  94.               Space,
  95.               VertGroupA|TRGR_FIXHORIZ,
  96.                 Space,
  97.                 Button("Top",3),
  98.                 Space,
  99.                 Button("Up",4),
  100.                 Space,
  101.                 Button("Down",5),
  102.                 Space,
  103.                 Button("Bottom",6),
  104.                 Space,
  105.                 Button("So_rt",7),
  106.                 Space,
  107.               EndGroup,
  108.               Space,
  109.             EndGroup,
  110.           Space,
  111.         EndGroup,
  112.  
  113.         Space,
  114.  
  115.         HorizGroupEA,
  116.           Space,
  117.           Button("_New...",8),
  118.           Space,
  119.           Button("_Edit...",9),
  120.           Space,
  121.           Button("Co_py",10),
  122.           Space,
  123.           Button("Remove",11),
  124.           Space,
  125.         EndGroup,
  126.  
  127.         Space,
  128.  
  129.         HorizGroupEA,
  130.           Space,
  131.           Button("_Save",12),
  132.           Space,
  133.           Button("_Use",13),
  134.           Space,
  135.           Button("_Test",14),
  136.           Space,
  137.           Button("_Cancel",15),
  138.           Space,
  139.         EndGroup,
  140.  
  141.         Space,
  142.  
  143.       EndGroup,
  144.  
  145.       TAG_END);
  146.     TR_CloseTriton();
  147.     return 0;
  148.   }
  149.   puts("Can't open triton.library v2+.");
  150.   return 20;
  151. }
  152.