Jump to content

A button beneath another widget keeps focus and border if mouse moves out of it and onto the widget above.


buzzdx
 Share

Go to solution Solved by Josh,

Recommended Posts

So this one is a bit hard to explain. By mystake I created a button which was partly below another widget created after the button. So half the button is visible, but the lower part is hidden behind a tree view. When I click on the button (press and let go) and then move the mouse down, leaving the button by entering the area of the tree control, the button does not notice it lost focus and will keep the blue border. It will notice only when I click on something else in the window. The following setup should illustrate and recreate the "problem". I'm not sure if it can be called a bug though, usually buttons won't be half behind other widgets i guess.

//Get displays
auto displays = GetDisplays();

//Create window
mainwindow = CreateWindow("xyz", 0, 0, 1040, 827, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

//Create user interface
ui = CreateInterface(mainwindow);		
iVec2 sz = ui->root->ClientSize();

auto mainpanel = CreatePanel(0, 9, sz.x, sz.y, ui->root);

auto btn_bdx = CreateButton("", 904, 80 /*20*/, 80, 80, mainpanel);

tree = CreateTreeView(10, 125, sz.x - 20, 500, mainpanel, TreeViewStyle::TREEVIEW_DEFAULT);


To replicate the behaviour: Move mouse onto button, click once. Then move mouse down onto the tree ctrl. The button will keep the blue border/focus state. Click anywhere in the window and the button will notice it has no focus anymore and remove blue border.

Thanks,

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...