mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
syncing uppdev
git-svn-id: svn://ultimatepp.org/upp/trunk@1929 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
e26d52b8d8
commit
03de5f35f6
17 changed files with 294 additions and 4 deletions
9
uppdev/ArrayCtrlCtrls/ArrayCtrlCtrls.upp
Normal file
9
uppdev/ArrayCtrlCtrls/ArrayCtrlCtrls.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
CtrlLib;
|
||||||
|
|
||||||
|
file
|
||||||
|
main.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "GUI";
|
||||||
|
|
||||||
49
uppdev/ArrayCtrlCtrls/main.cpp
Normal file
49
uppdev/ArrayCtrlCtrls/main.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
#include <CtrlLib/CtrlLib.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
struct EditStringSpecial : EditString {
|
||||||
|
ArrayCtrl *GetArrayCtrl() {
|
||||||
|
for(Ctrl *q = GetParent(); q; q = q->GetParent())
|
||||||
|
if(ArrayCtrl *a = dynamic_cast<ArrayCtrl *>(q))
|
||||||
|
return a;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void DoMenu(EditStringSpecial *x) {
|
||||||
|
MenuBar bar;
|
||||||
|
x->StdBar(bar);
|
||||||
|
ArrayCtrl *a = x->GetArrayCtrl();
|
||||||
|
if(a) {
|
||||||
|
bar.Separator();
|
||||||
|
a->WhenBar(bar);
|
||||||
|
}
|
||||||
|
bar.Execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyBar(Bar& bar)
|
||||||
|
{
|
||||||
|
PostCallback(callback1(DoMenu, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef EditStringSpecial CLASSNAME;
|
||||||
|
|
||||||
|
EditStringSpecial() {
|
||||||
|
WhenBar = THISBACK(MyBar);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GUI_APP_MAIN
|
||||||
|
{
|
||||||
|
ArrayCtrl a;
|
||||||
|
a.Appending().Removing();
|
||||||
|
a.AddColumn("Text").Ctrls<EditStringSpecial>();
|
||||||
|
for(int i = 0; i < 300; i++)
|
||||||
|
a.Add(AsString(i));
|
||||||
|
a.SetLineCy(Draw::GetStdFontCy() + 8);
|
||||||
|
|
||||||
|
TopWindow app;
|
||||||
|
app.Add(a.SizePos());
|
||||||
|
app.Sizeable();
|
||||||
|
app.Run();
|
||||||
|
}
|
||||||
10
uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.cpp
Normal file
10
uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.cpp
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
ArrayMap<int, int> x, y;
|
||||||
|
BREAK_WHEN_PICKED(x);
|
||||||
|
x = y;
|
||||||
|
}
|
||||||
9
uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.upp
Normal file
9
uppdev/BREAK_ON_PICKED/BREAK_ON_PICKED.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
BREAK_ON_PICKED.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
|
|
@ -2,10 +2,18 @@
|
||||||
|
|
||||||
using namespace Upp;
|
using namespace Upp;
|
||||||
|
|
||||||
|
int compactcommandline()
|
||||||
|
/**/{
|
||||||
|
int goo;
|
||||||
|
|
||||||
|
go
|
||||||
|
|
||||||
|
int i,j;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyTest() {}
|
||||||
|
|
||||||
CONSOLE_APP_MAIN
|
CONSOLE_APP_MAIN
|
||||||
{
|
{
|
||||||
CParser p("i if while 12345 alfa");
|
MyTes(*)
|
||||||
__BREAK__;
|
|
||||||
int q = p.Id("i") + p.Id("if") + p.Id("while");
|
|
||||||
Cout() << q;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
7
uppdev/GetLanguages/GetLanguages.cpp
Normal file
7
uppdev/GetLanguages/GetLanguages.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
9
uppdev/GetLanguages/GetLanguages.upp
Normal file
9
uppdev/GetLanguages/GetLanguages.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
GetLanguages.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
11
uppdev/GetTranslationLanguages/GetTranslationLanguages.cpp
Normal file
11
uppdev/GetTranslationLanguages/GetTranslationLanguages.cpp
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
Index<int> x = GetLngSet();
|
||||||
|
for(int i = 0; i < x.GetCount(); i++)
|
||||||
|
DDUMP(LNGAsText(x[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
GetTranslationLanguages.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
9
uppdev/SplitterBug/SplitterBug.upp
Normal file
9
uppdev/SplitterBug/SplitterBug.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
CtrlLib;
|
||||||
|
|
||||||
|
file
|
||||||
|
main.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "GUI";
|
||||||
|
|
||||||
37
uppdev/SplitterBug/main.cpp
Normal file
37
uppdev/SplitterBug/main.cpp
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include <CtrlLib/CtrlLib.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
class TestSplitter : public TopWindow
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
// pages column list
|
||||||
|
ColumnList pageList;
|
||||||
|
|
||||||
|
// page container
|
||||||
|
StaticRect pagePane;
|
||||||
|
|
||||||
|
// the splitter
|
||||||
|
Splitter splitter;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TestSplitter();
|
||||||
|
};
|
||||||
|
|
||||||
|
TestSplitter::TestSplitter()
|
||||||
|
{
|
||||||
|
// adds the splitter
|
||||||
|
// SizePos();
|
||||||
|
Add(splitter);
|
||||||
|
|
||||||
|
// setup pagelist appearance
|
||||||
|
pageList.Columns(1).SizePos();
|
||||||
|
|
||||||
|
// adds the columnlist on left
|
||||||
|
splitter.Horz(pageList, pagePane).SetPos(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
GUI_APP_MAIN
|
||||||
|
{
|
||||||
|
TestSplitter().Run();
|
||||||
|
}
|
||||||
9
uppdev/TreeCtrlCanOpen/TreeCtrlCanOpen.upp
Normal file
9
uppdev/TreeCtrlCanOpen/TreeCtrlCanOpen.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
CtrlLib;
|
||||||
|
|
||||||
|
file
|
||||||
|
main.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "GUI";
|
||||||
|
|
||||||
53
uppdev/TreeCtrlCanOpen/main.cpp
Normal file
53
uppdev/TreeCtrlCanOpen/main.cpp
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
#include "CtrlLib/CtrlLib.h"
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
struct App : TopWindow {
|
||||||
|
TreeCtrl tree;
|
||||||
|
|
||||||
|
typedef App CLASSNAME;
|
||||||
|
|
||||||
|
void OpenDir(int id) {
|
||||||
|
String path = tree[id];
|
||||||
|
|
||||||
|
for(FindFile ff(AppendFileName(path, "*.*")); ff; ff.Next()) {
|
||||||
|
String n = ff.GetName();
|
||||||
|
|
||||||
|
if(n != "." && n != ".." && ff.IsFolder()) {
|
||||||
|
tree.Add(id, CtrlImg::Dir(),
|
||||||
|
AppendFileName(path, n), n, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// I expect to get the +/- sign removed if a folder does not contain other folders
|
||||||
|
// using the following code:
|
||||||
|
if (tree.GetChildCount(id) == 0)
|
||||||
|
{
|
||||||
|
TreeCtrl::Node node = tree.GetNode(id);
|
||||||
|
node.CanOpen(false);
|
||||||
|
tree.SetNode(id, node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CloseDir(int id) {
|
||||||
|
tree.RemoveChildren(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
App() {
|
||||||
|
Add(tree.SizePos());
|
||||||
|
|
||||||
|
tree.WhenOpen = THISBACK(OpenDir);
|
||||||
|
tree.WhenClose = THISBACK(CloseDir);
|
||||||
|
|
||||||
|
String dir = "u:/upp.src";
|
||||||
|
|
||||||
|
tree.SetRoot(CtrlImg::Dir(), dir);
|
||||||
|
|
||||||
|
Sizeable();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GUI_APP_MAIN
|
||||||
|
{
|
||||||
|
App().Run();
|
||||||
|
}
|
||||||
20
uppdev/XmlizeTest/XmlizeTest.cpp
Normal file
20
uppdev/XmlizeTest/XmlizeTest.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct MyVector : public Vector<T> {
|
||||||
|
void Foo() {}
|
||||||
|
|
||||||
|
void Xmlize(XmlIO xml) {
|
||||||
|
Upp::Xmlize(xml, *this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
MyVector<int> x;
|
||||||
|
x.Add(10);
|
||||||
|
DDUMP(StoreAsXML(x, "test"));
|
||||||
|
LOG("XXX");
|
||||||
|
}
|
||||||
9
uppdev/XmlizeTest/XmlizeTest.upp
Normal file
9
uppdev/XmlizeTest/XmlizeTest.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
XmlizeTest.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
23
uppdev/tt/tt.cpp
Normal file
23
uppdev/tt/tt.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#include <Core/Core.h>
|
||||||
|
|
||||||
|
using namespace Upp;
|
||||||
|
|
||||||
|
struct tt_char {
|
||||||
|
const char *s;
|
||||||
|
|
||||||
|
String ToString() const { return GetLngString(s); }
|
||||||
|
operator const char *() const { return ToString(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
CONSOLE_APP_MAIN
|
||||||
|
{
|
||||||
|
static tt_char x[] = {
|
||||||
|
tt_("Aborted by user."),
|
||||||
|
tt_("Two"),
|
||||||
|
tt_("Three")
|
||||||
|
};
|
||||||
|
|
||||||
|
SetLanguage(LNG_('I','T','I','T'));
|
||||||
|
DDUMP(x[0]);
|
||||||
|
}
|
||||||
|
|
||||||
9
uppdev/tt/tt.upp
Normal file
9
uppdev/tt/tt.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
uses
|
||||||
|
Core;
|
||||||
|
|
||||||
|
file
|
||||||
|
tt.cpp;
|
||||||
|
|
||||||
|
mainconfig
|
||||||
|
"" = "";
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue