mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
.reference
git-svn-id: svn://ultimatepp.org/upp/trunk@10274 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
8b96b11e8c
commit
c8dbd68e1d
18 changed files with 55 additions and 67 deletions
|
|
@ -1,4 +1,4 @@
|
|||
description "The definition and use of redefinable key accelerators";
|
||||
description "The definition and use of redefinable key accelerators\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
|
|
|||
7
reference/AK/init
Normal file
7
reference/AK/init
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef _AK_icpp_init_stub
|
||||
#define _AK_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#define BLITZ_INDEX__ Fd9b2e96dcfffad7e520d84eddd91da83
|
||||
#include "ak.icpp"
|
||||
#undef BLITZ_INDEX__
|
||||
#endif
|
||||
|
|
@ -14,15 +14,15 @@ void App::Fn(String text)
|
|||
|
||||
void App::AkMenu(Bar& menu)
|
||||
{
|
||||
menu.Add(AK_FN1, THISBACK1(Fn, "1"));
|
||||
menu.Add(AK_FN2, THISBACK1(Fn, "2"));
|
||||
menu.Add(AK_EXIT, THISBACK(Close));
|
||||
menu.Add(AK_FN1, [=] { Fn("1"); });
|
||||
menu.Add(AK_FN2, [=] { Fn("2"); });
|
||||
menu.Add(AK_EXIT, [=] { Close(); });
|
||||
}
|
||||
|
||||
void App::MainMenu(Bar& menu)
|
||||
{
|
||||
menu.Add("AK", THISBACK(AkMenu));
|
||||
menu.Add(t_("Setup"), THISBACK(SetupMenu));
|
||||
menu.Sub("AK", [=](Bar& bar) { AkMenu(bar); });
|
||||
menu.Sub(t_("Setup"), [=](Bar& bar) { SetupMenu(bar); });
|
||||
}
|
||||
|
||||
App::App()
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
void App::SetLang(int lang)
|
||||
{
|
||||
SetLanguage(lang);
|
||||
menubar.Set(THISBACK(MainMenu));
|
||||
menubar.Set([=] (Bar& bar) { MainMenu(bar); });
|
||||
}
|
||||
|
||||
void App::SetupMenu(Bar& menu)
|
||||
{
|
||||
menu.Add(AK_ENGLISH, THISBACK1(SetLang, LNGC_('E','N','U','S', CHARSET_UTF8)))
|
||||
menu.Add(AK_ENGLISH, [=] { SetLang(LNGC_('E','N','U','S', CHARSET_UTF8)); })
|
||||
.Radio(GetCurrentLanguage() == LNGC_('E','N','U','S', CHARSET_UTF8));
|
||||
menu.Add(AK_CZECH, THISBACK1(SetLang, LNGC_('C','S','C','Z', CHARSET_UTF8)))
|
||||
menu.Add(AK_CZECH, [=] { SetLang(LNGC_('C','S','C','Z', CHARSET_UTF8)); })
|
||||
.Radio(GetCurrentLanguage() == LNGC_('C','S','C','Z', CHARSET_UTF8));
|
||||
menu.Separator();
|
||||
menu.Add(AK_KEYS, callback(EditKeys));
|
||||
menu.Add(AK_KEYS, [=] { EditKeys(); });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ public:
|
|||
AnimatedClip();
|
||||
|
||||
void Browse();
|
||||
void Play();
|
||||
void Stop();
|
||||
void OpenNext();
|
||||
void ChangeThreads();
|
||||
|
||||
void OnShown();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ file
|
|||
main.cpp,
|
||||
AnimatedClip.lay,
|
||||
AnimatedClip.brc,
|
||||
arkearth_e0.gif,
|
||||
arrtan_e0.gif,
|
||||
Credits.txt;
|
||||
|
||||
mainconfig
|
||||
|
|
|
|||
|
|
@ -9,17 +9,17 @@ using namespace Upp;
|
|||
AnimatedClip::AnimatedClip() {
|
||||
CtrlLayout(*this, "RasterPlayer demo");
|
||||
|
||||
browse <<= THISBACK(Browse);
|
||||
play <<= THISBACK(Play);
|
||||
stop <<= THISBACK(Stop);
|
||||
openNext <<= THISBACK(OpenNext);
|
||||
browse << [=] { Browse(); };
|
||||
play << [=] { clip.Play(); };
|
||||
stop << [=] { clip.Stop(); };
|
||||
openNext << [=] { clip.NextFrame(); };
|
||||
numThreads << [=] { clip.SetMT(numThreads == 1); };
|
||||
numThreads = 0;
|
||||
numThreads <<= THISBACK(ChangeThreads);
|
||||
#ifndef _MULTITHREADED
|
||||
numThreads.EnableCase(1, false);
|
||||
#endif
|
||||
|
||||
clip.WhenShown = THISBACK(OnShown);
|
||||
clip.WhenShown << [=] { openedPage = FormatInt(clip.GetPage()); };
|
||||
arrows.LoadBuffer(String(animatedArrow, animatedArrow_length));
|
||||
arrows.Play();
|
||||
earth.LoadBuffer(String(animatedEarth, animatedEarth_length));
|
||||
|
|
@ -45,26 +45,6 @@ void AnimatedClip::Browse() {
|
|||
openedPage = FormatInt(clip.GetPage());
|
||||
}
|
||||
|
||||
void AnimatedClip::Play() {
|
||||
clip.Play();
|
||||
}
|
||||
|
||||
void AnimatedClip::Stop() {
|
||||
clip.Stop();
|
||||
}
|
||||
|
||||
void AnimatedClip::OpenNext() {
|
||||
clip.NextFrame();
|
||||
}
|
||||
|
||||
void AnimatedClip::OnShown() {
|
||||
openedPage = FormatInt(clip.GetPage());
|
||||
}
|
||||
|
||||
void AnimatedClip::ChangeThreads() {
|
||||
clip.SetMT(numThreads == 1);
|
||||
}
|
||||
|
||||
GUI_APP_MAIN {
|
||||
AnimatedClip().Run();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ struct ArrayCtrlExample : public WithDlgLayout<TopWindow> {
|
|||
|
||||
void DoubleClick();
|
||||
|
||||
typedef ArrayCtrlExample CLASSNAME;
|
||||
|
||||
ArrayCtrlExample();
|
||||
};
|
||||
|
||||
|
|
@ -51,7 +49,7 @@ ArrayCtrlExample::ArrayCtrlExample()
|
|||
array.AddColumn("with display").SetDisplay(Single<MyDisplay>());
|
||||
array.AddCtrl(editor);
|
||||
array.AddRowNumColumn("rownum");
|
||||
array.WhenLeftDouble = THISBACK(DoubleClick);
|
||||
array.WhenLeftDouble = [=] { DoubleClick(); };
|
||||
array.ColumnWidths("51 120 60 102 62");
|
||||
|
||||
for(int i = 0; i < 20; i++)
|
||||
|
|
|
|||
|
|
@ -56,19 +56,17 @@ struct App : TopWindow {
|
|||
b.RemoveSelection();
|
||||
}
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
a.AddColumn("You can paste the text here too");
|
||||
a.MultiSelect();
|
||||
a.WhenDropInsert = THISBACK(DnDInsert);
|
||||
a.WhenDrop = THISBACK(DnD);
|
||||
a.WhenDrag = THISBACK(Drag);
|
||||
a.WhenDropInsert = [=](int line, PasteClip& d) { DnDInsert(line, d); };
|
||||
a.WhenDrop = [=] (PasteClip& d) { DnD(d); };
|
||||
a.WhenDrag = [=] { Drag(); };
|
||||
|
||||
b.AddColumn("Roman numbers");
|
||||
b.MultiSelect();
|
||||
b.WhenDropInsert = THISBACK(DnDInsertB);
|
||||
b.WhenDrag = THISBACK(DragB);
|
||||
b.WhenDropInsert = [=](int line, PasteClip& d) { DnDInsertB(line, d); };
|
||||
b.WhenDrag = [=] { DragB(); };
|
||||
|
||||
Add(s.Horz(a, b));
|
||||
for(int i = 0; i < 200; i++) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ using namespace Upp;
|
|||
struct App : public WithAppLayout<TopWindow> {
|
||||
EditDouble editdbl;
|
||||
|
||||
typedef App CLASSNAME;
|
||||
App();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
description "Embedding non-owned widgets into ArrayCtrl";
|
||||
description "Embedding non-owned widgets into ArrayCtrl\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
|
|
|||
4
reference/ArrayCtrlSetCtrl/init
Normal file
4
reference/ArrayCtrlSetCtrl/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _ArrayCtrlSetCtrl_icpp_init_stub
|
||||
#define _ArrayCtrlSetCtrl_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
|
|
@ -13,14 +13,12 @@ struct App : TopWindow {
|
|||
option[i].Enable(i == ii || option[ii]);
|
||||
}
|
||||
|
||||
typedef App CLASSNAME;
|
||||
|
||||
App() {
|
||||
a.AddColumn("Option");
|
||||
for(int i = 0; i < 300; i++) {
|
||||
a.Add(bool(i & 4));
|
||||
a.SetCtrl(i, 0, option.Add().SetLabel("Option " + AsString(i)));
|
||||
option.Top() <<= THISBACK1(Do, i);
|
||||
option.Top() << [=] { Do(i); };
|
||||
}
|
||||
a.SetLineCy(Draw::GetStdFontCy() + 8);
|
||||
Add(a.SizePos());
|
||||
|
|
|
|||
4
reference/ArrayHideShowColumnMenu/init
Normal file
4
reference/ArrayHideShowColumnMenu/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _ArrayHideShowColumnMenu_icpp_init_stub
|
||||
#define _ArrayHideShowColumnMenu_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
|
|
@ -8,7 +8,6 @@ using namespace Upp;
|
|||
|
||||
class MainWindow : public WithMainWindowLayout<TopWindow> {
|
||||
public:
|
||||
typedef MainWindow CLASSNAME;
|
||||
MainWindow();
|
||||
void Serialize(Stream& s);
|
||||
protected:
|
||||
|
|
@ -22,7 +21,7 @@ MainWindow::MainWindow()
|
|||
{
|
||||
CtrlLayout(*this, "Array Hide/Show Column Menu demonstration");
|
||||
Sizeable();
|
||||
m_array.WhenBar = THISBACK(OnArrayBar);
|
||||
m_array.WhenBar = [=](Bar& menu) { OnArrayBar(menu); };
|
||||
m_array.AllSorting();
|
||||
|
||||
|
||||
|
|
@ -71,7 +70,7 @@ void MainWindow::OnArrayBar(Bar &menu)
|
|||
for(int i=0; i<header.GetCount(); i++){
|
||||
bool visible = header.IsTabVisible(i);
|
||||
String label = header[i].GetText();
|
||||
menu.Add(label, THISBACK2(ShowColumn, i, !visible)).Check(visible);
|
||||
menu.Add(label, [=] { ShowColumn(i, !visible); }).Check(visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
description "Skinning Button using Chameleon";
|
||||
description "Skinning Button using Chameleon\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
|
|
|||
4
reference/Chameleon/init
Normal file
4
reference/Chameleon/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _Chameleon_icpp_init_stub
|
||||
#define _Chameleon_icpp_init_stub
|
||||
#include "CtrlLib/init"
|
||||
#endif
|
||||
|
|
@ -94,7 +94,6 @@ struct MyApp : WithChameleonLayout<TopWindow> {
|
|||
void Set(void (*skin)());
|
||||
Button::Style scolor, simage, sfn;
|
||||
|
||||
typedef MyApp CLASSNAME;
|
||||
MyApp();
|
||||
};
|
||||
|
||||
|
|
@ -106,16 +105,16 @@ void MyApp::Set(void (*skin)())
|
|||
MyApp::MyApp()
|
||||
{
|
||||
CtrlLayout(*this, "Chameleon example");
|
||||
host <<= THISBACK1(Set, ChHostSkin);
|
||||
std <<= THISBACK1(Set, ChStdSkin);
|
||||
classic <<= THISBACK1(Set, ChClassicSkin);
|
||||
color <<= THISBACK1(Set, ColorSkin);
|
||||
host << [=] { Set(ChHostSkin); };
|
||||
std << [=] { Set(ChStdSkin); };
|
||||
classic << [=] { Set(ChClassicSkin); };
|
||||
color << [=] { Set(ColorSkin); };
|
||||
scolor = ColorStyle();
|
||||
color.SetStyle(scolor);
|
||||
img <<= THISBACK1(Set, ImageSkin);
|
||||
simage= ImageStyle();
|
||||
img << [=] { Set(ImageSkin); };
|
||||
simage = ImageStyle();
|
||||
img.SetStyle(simage);
|
||||
fn <<= THISBACK1(Set, FnSkin);
|
||||
fn << [=] { Set(FnSkin); };
|
||||
sfn = FnStyle();
|
||||
fn.SetStyle(sfn);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue