2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
6 * > Main Overarching UI
9 #include "resources/LogoSmall.sif.res.h"
12 int giInterface_Width = 0;
13 int giInterface_HeaderBarSize = 20;
14 int giInterface_TabBarSize = 20;
15 tElement *gpInterface_Sidebar;
16 tElement *gpInterface_ProgramList;
17 tElement *gpInterface_MainArea;
18 tElement *gpInterface_HeaderBar;
19 tElement *gpInterface_TabBar;
20 tElement *gpInterface_TabContent;
21 const char csLogoSmall[] = "base64:///"RESOURCE_LogoSmall_sif;
25 * \brief Initialise the UI
27 void Interface_Init(void)
33 giInterface_Width = giScreenWidth/16;
35 // Set root window to no-border
38 // -- Create Sidebar --
39 gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar");
40 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
42 // > System Menu Button
43 btn = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu");
44 WM_SetSize(btn, giInterface_Width-4);
45 // TODO: Once image loading is implemented, switch to a logo
47 //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE);
48 text = WM_CreateElement(btn, ELETYPE_IMAGE, 0, "MenuLogo");
49 //WM_SetText(text, "file:///LogoSmall.sif");
50 WM_SetText(text, csLogoSmall);
52 text = WM_CreateElement(btn, ELETYPE_TEXT, 0, NULL);
53 WM_SetText(text, "Acess");
55 // > Plain <hr/> style spacer
56 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
59 gpInterface_ProgramList = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");
60 // > Plain <hr/> style spacer
61 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom");
64 text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
66 WM_SetText(text, "2.0");
69 // -- Create Main Area and regions within --
72 gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea");
73 // > Header Bar (Title)
74 gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar");
75 WM_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize);
76 text = WM_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL);
77 WM_SetText(text, "Acess2 GUI - By thePowersGang (John Hodge)");
78 // > Tab Bar (Current windows)
79 gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar");
80 WM_SetSize(gpInterface_TabBar, giInterface_TabBarSize);
81 // > Application Space
82 gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent");
85 void Interface_Update(void)
87 giInterface_Width = giScreenWidth/16;
88 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
91 void Interface_Render(void)
96 giInterface_Width, giScreenHeight,