2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
6 * > Main Overarching UI
11 int giInterface_Width = 0;
12 int giInterface_HeaderBarSize = 20;
13 int giInterface_TabBarSize = 20;
14 tElement *gpInterface_Sidebar;
15 tElement *gpInterface_ProgramList;
16 tElement *gpInterface_MainArea;
17 tElement *gpInterface_HeaderBar;
18 tElement *gpInterface_TabBar;
19 tElement *gpInterface_TabContent;
23 * \brief Initialise the UI
25 void Interface_Init(void)
31 giInterface_Width = giScreenWidth/16;
33 // Set root window to no-border
36 // -- Create Sidebar --
37 gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar");
38 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
40 // > System Menu Button
41 btn = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu");
42 WM_SetSize(btn, giInterface_Width-4);
43 // TODO: Once image loading is implemented, switch to a logo
45 text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE);
46 WM_SetText(text, "asset://LogoSmall.sif");
48 text = WM_CreateElement(btn, ELETYPE_TEXT, 0, NULL);
49 WM_SetText(text, "Acess");
51 // > Plain <hr/> style spacer
52 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
55 gpInterface_ProgramList = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");
56 // > Plain <hr/> style spacer
57 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom");
60 text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
62 WM_SetText(text, "2.0");
65 // -- Create Main Area and regions within --
68 gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea");
69 // > Header Bar (Title)
70 gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar");
71 WM_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize);
72 text = WM_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL);
73 WM_SetText(text, "Acess2 GUI - By thePowersGang (John Hodge)");
74 // > Tab Bar (Current windows)
75 gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar");
76 WM_SetSize(gpInterface_TabBar, giInterface_TabBarSize);
77 // > Application Space
78 gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent");
81 void Interface_Update(void)
83 giInterface_Width = giScreenWidth/16;
84 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
87 void Interface_Render(void)
92 giInterface_Width, giScreenHeight,