mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
40 lines
795 B
C++
40 lines
795 B
C++
#include "ToolBarAsCtrl.h"
|
|
|
|
#define IMAGECLASS ToolBarImg
|
|
#define IMAGEFILE <ToolBarAsCtrl/ToolBar.iml>
|
|
#include <Draw/iml.h>
|
|
|
|
void ToolBarAsCtrl::MyBar(Bar& tb)
|
|
{
|
|
tb.Add("Test",ToolBarImg::heart(),THISBACK(DoNothing));
|
|
tb.Add(h);
|
|
}
|
|
|
|
ToolBarAsCtrl::ToolBarAsCtrl()
|
|
{
|
|
CtrlLayout(*this, "Window title");
|
|
tb.SetRect(10,10,200,50);
|
|
Add(tb);
|
|
tb.Set(THISBACK(MyBar));
|
|
//in 3 seconds you will see the button
|
|
// SetTimeCallback(3000,THISBACK(ShowToolBarButtons));
|
|
}
|
|
|
|
void ToolBarAsCtrl::DoNothing() {
|
|
//just to have a callback function
|
|
};
|
|
|
|
void ToolBarAsCtrl::ShowToolBarButtons() {
|
|
tb.RefreshLayout();
|
|
};
|
|
|
|
void ToolBarAsCtrl::Layout() {
|
|
//doesn't work in Layout!
|
|
ShowToolBarButtons();
|
|
// tb.Transparent();
|
|
};
|
|
|
|
GUI_APP_MAIN
|
|
{
|
|
ToolBarAsCtrl().Run();
|
|
}
|