X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Finterface.c;h=af02429a562dc577bb4ed26f26482595fb7a0d81;hb=2b28991acfe9e9014eb14dd47def8e31e4c2b7e4;hp=1eec6b4e67a6c44adc8775f7acc4ccddb1b2a65a;hpb=fae1f1d96fc1e923aabc87d11ed0dfcf4d17a36b;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/interface.c b/Usermode/Applications/axwin2_src/WM/interface.c index 1eec6b4e..af02429a 100644 --- a/Usermode/Applications/axwin2_src/WM/interface.c +++ b/Usermode/Applications/axwin2_src/WM/interface.c @@ -1,6 +1,9 @@ /* * Acess GUI (AxWin) Version 2 * By John Hodge (thePowersGang) + * + * interface.c + * > Main Overarching UI */ #include "common.h" @@ -13,43 +16,54 @@ tElement *gpInterface_TabBar; tElement *gpInterface_TabContent; // === CODE === +/** + * \brief Initialise the UI + */ void Interface_Init(void) { + tElement *area; tElement *btn, *text; + // Calculate sizes giInterface_Width = giScreenWidth/16; - WM_SetFlags(NULL, ELEFLAG_HORIZONTAL); + // Set root window to no-border + WM_SetFlags(NULL, 0); - // Create Sidebar + // -- Create Sidebar -- gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL); WM_SetSize( gpInterface_Sidebar, giInterface_Width ); - // Create Main Area and regions within - gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL); - gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, ELEFLAG_HORIZONTAL); - gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0); - gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0); - // Menu Button - btn = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, 0); + // --- Top segment --- + area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL); + // ---- Menu Button ---- + btn = WM_CreateElement(area, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH); WM_SetSize(btn, giInterface_Width); //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE); - //WM_SetText(text, "asset://LogoSmall.png"); + //WM_SetText(text, "asset://LogoSmall.sif"); text = WM_CreateElement(btn, ELETYPE_TEXT, 0); WM_SetText(text, "Acess"); - // Plain
style spacer - WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, 0); + // ---- Plain
style spacer ---- + WM_CreateElement(area, ELETYPE_SPACER, 0); + + // Open Windows Go Here - // Create spacing gap (aligns the rest to the bottom/right) - WM_CreateElement(gpInterface_Sidebar, ELETYPE_GAP, 0); + // --- Bottom Segment --- + area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL|ELEFLAG_ALIGN_END); - // Plain
style spacer - WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, 0); + // ---- Plain
style spacer ---- + WM_CreateElement(area, ELETYPE_SPACER, 0); - // Version String - text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_WRAP); + // ---- Version String ---- + text = WM_CreateElement(area, ELETYPE_TEXT, ELEFLAG_WRAP); WM_SetText(text, "AxWin 1.0"); + + // -- Create Main Area and regions within -- + gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL); + gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0); + gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0); + gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0); } void Interface_Update(void)