Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Toolbar clears after ESC key [solved, it`s the bug in user code]
Toolbar clears after ESC key [solved, it`s the bug in user code] [message #12082] |
Wed, 10 October 2007 18:33 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
I have a toolbar on my topwindow and a simple test routine for adding icons for toolbar:
class MainWindow : public WithMainWindowLayout<TopWindow> {
public:
typedef MainWindow CLASSNAME;
MainWindow();
private:
void SetToolBarState();
void OnUpdateToolbar(Bar &bar);
void OnLockUnlock();
[COLOR=blue]ToolBar toolbar;[/COLOR]
ToolBarState toolbarState;
bool buttonClose;
};
MainWindow::MainWindow()
{
::CtrlLayout(*this);
AddFrame(toolbar);
toolbar.AddFrame(BottomSeparatorFrame());
Title(t_("Диспетчер готовой продукции 0.1"));
Icon(DispRVPFImages::DISP_RVPF);
LargeIcon(DispRVPFImages::DISP_RVPF);
//Zoomable().Sizeable().
MinimizeBox(false).Sizeable(false).SetRect(0,0,1024,768);
[COLOR=blue]SetToolBarState();[/COLOR]
}
void MainWindow::SetToolBarState()
{
//...
toolbar.Set(THISBACK(OnUpdateToolbar));
}
void MainWindow::OnUpdateToolbar(Bar &bar)
{
toolbar.Clear();
toolbar.Add(t_("*********"), DispRVPFImages::dailyReport,THISBACK(OnLockUnlock));
toolbar.GapRight();
toolbar.Add(t_("*********"), DispRVPFImages::unlock,THISBACK(OnLockUnlock));
toolbar.Separator();
toolbar.Add(t_("*********"), DispRVPFImages::report,THISBACK(OnLockUnlock));
toolbar.Add(t_("*********"), DispRVPFImages::archive,THISBACK(OnLockUnlock));
toolbar.Add(t_("*********"), DispRVPFImages::options,THISBACK(OnLockUnlock));
}
It works fine on executing the application. But pressing ESC key clears toolbar icons. Is it a bug, or I`m doing something wrong?
I tried not to use toolbar.Clear(); in MainWindow::OnUpdateToolbar, but in some repainting cases toolbar just copies it`s icons twice or more times.
[Updated on: Wed, 10 October 2007 21:53] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Mon Apr 29 10:26:17 CEST 2024
Total time taken to generate the page: 0.02710 seconds
|