Jump to content

How can i place my sidepanel on the left side?


Vida Marcell
 Share

Recommended Posts

#include "UltraEngine.h"

using namespace UltraEngine;

const int STATUSBARHEIGHT = 32;
const int SIDEPANELWIDTH = 300;
const int CONSOLEHEIGHT = 120;

int main(int argc, const char* argv[])
{
    //Get the displays
    auto displays = GetDisplays();

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 920, 680, displays[0]);

    //Create User Interface
    auto ui = CreateInterface(window);
    iVec2 sz = ui->root->ClientSize();

    auto mainmenu = CreateMenu("", ui->root);
    mainmenu->SetColor(0, 1, 1);

    auto statusbar = CreatePanel(0, sz.y - STATUSBARHEIGHT, sz.x, STATUSBARHEIGHT, ui->root);
    statusbar->SetLayout(1, 1, 0, 1);
    statusbar->SetColor(0, 1, 0);

    auto mainpanel = CreatePanel(0, mainmenu->position.y + mainmenu->size.y, sz.x, sz.y - mainmenu->size.y - mainmenu->position.y - statusbar->size.y, ui->root);
    mainpanel->SetLayout(1, 1, 1, 1);
    sz = mainpanel->ClientSize();
    mainpanel->SetColor(0, 0, 1);

    auto sidepanel = CreatePanel(sz.x - SIDEPANELWIDTH, 0, SIDEPANELWIDTH, sz.y, mainpanel);
    sidepanel->SetLayout(0, 1, 1, 1);
    sidepanel->SetColor(1, 0, 0);

    while (window->Closed() == false)
    {
        WaitEvent();
    }
    return 0;
}

image.thumb.png.1e4a1973c0269fd14a7e74ab9985ae95.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...