Syncing uppdev

git-svn-id: svn://ultimatepp.org/upp/trunk@1636 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-10-19 08:54:51 +00:00
parent e5b37792f1
commit 5fe86cd0e1
6 changed files with 138 additions and 50 deletions

View file

@ -5,6 +5,11 @@ using namespace Upp;
struct App : public TopWindow {
bool numbers_enabled;
EditString test;
Point p;
ArrayCtrl list;
virtual void MouseMove(Point p, dword keyflags);
virtual void Paint(Draw& w);
void Action2(int a, int b) { PromptOK(AsString(a) + AsString(b)); }
@ -65,12 +70,15 @@ struct App : public TopWindow {
MainBar(bar);
bar.Execute();
}
virtual void LeftDown(Point p, dword)
void CloseSubMenu()
{
MenuBar bar;
BigMenu(bar);
bar.Execute();
list.Add("Close");
}
void OpenSubMenu()
{
list.Add("Open");
}
MenuBar menu;
@ -82,9 +90,26 @@ struct App : public TopWindow {
numbers_enabled = true;
AddFrame(menu);
menu.Set(THISBACK(MainBar));
menu.WhenSubMenuClose = THISBACK(CloseSubMenu);
menu.WhenSubMenuOpen = THISBACK(OpenSubMenu);
list.AddColumn();
Add(list.RightPos(0, 200).VSizePos());
}
};
void App::MouseMove(Point p, dword keyflags)
{
this->p = p;
Refresh();
}
void App::Paint(Draw& w)
{
w.DrawRect(GetSize(), White());
w.DrawText(100, 100, AsString(p));
}
GUI_APP_MAIN
{
App().Run();

View file

@ -1,9 +1,12 @@
uses
CtrlLib,
Report;
file
main.cpp;
mainconfig
"" = "GUI";
uses
CtrlLib,
Report,
PdfDraw,
Painter;
file
main.cpp;
mainconfig
"" = "GUI";

7
uppdev/Rep/init Normal file
View file

@ -0,0 +1,7 @@
#ifndef _Rep_icpp_init_stub
#define _Rep_icpp_init_stub
#include "CtrlLib/init"
#include "Report/init"
#include "PdfDraw/init"
#include "Painter/init"
#endif

View file

@ -1,42 +1,77 @@
#include <CtrlLib/CtrlLib.h>
#include <Report/Report.h>
using namespace Upp;
GUI_APP_MAIN
{
String qtf;
Vector<String> data;
int rows=4;
int cols=3;
int i;
double leftMargin=1.0;
double topMargin=.5;
// 8.5" x 600 dots/in = 5100 dots
// 11" x 600 dots/in = 6600 dots
Size sz(5100-(1200*leftMargin),6600-(1200*topMargin));
Report report(sz);
int rowheight=(sz.cy - 4 * (rows - 1) - 20) /rows;
for(i=1;i<(rows*cols+1);i++)
data.Add("cell "+AsString(i));
qtf << "[ $$0,0#00000000000000000000000000000000:Default]";
qtf << "[{_}\r\n";
qtf << "[ {{500";
for(i=1;i<cols;i++)
qtf << ":500";
qtf << "H" << rowheight << "l/0r/0t/0b/0 ";
// Cell one doesn't start with ::
qtf << "[s0;= " << data[0] << "]\r\n";
for(i=1;i<data.GetCount();i++)
{
qtf << ":: [s0;= " << data[i] << "]\r\n";
}
qtf << "}}]\r\n";
report << qtf;
Perform(report);
Report r;
r << "[ $$0,0#00000000000000000000000000000000:Default]"
"[{_} "
"[ {{1755:848:856:846:834:869:795:3197@7|2 [s0;=%% [*2 Points]]"
"::|2 [s0;=%% [*2 CH]]"
":: [s0;=%% [*2 Dist]]"
":: [s0;=%% [*2 GS]]"
":: [s0;=%% [*2 ETE]]"
":: [s0;=%% [*2 ETA]]"
":: [s0;=%% [*2 Fuel U]]"
"::|2 [s0;=%% [*2 Notes]]"
"::@2 [s0; ]"
":: [s0; ]"
"::@7 [s0;=%% [*2 Rem]]"
":: [s0;=%% [*2 Act]]"
":: [s0;=%% [*2 ATE]]"
":: [s0;=%% [*2 ATA]]"
":: [s0;=%% [*2 Fuel R]]"
"::@2 [s0; ]"
":: [s0; ]"
":: [s0; ]"
"::@7 [s0;=%% [*2 `@TD]]"
":: [s0;=%% [*2 <`- Tot]]"
":: [s0;=%% [*2 Off `->]]"
"::@2 [s0;=*2%% ]"
"::@7 [s0;=%% [*2 `@FT]]"
"::@2 [s0; ]"
":: [s0;= `@SP]"
"::|1 [s0;= `@CH]"
":: [s0;=%% `@D]"
":: [s0;=%% `@GS]"
":: [s0;=%% `@E]"
":: [s0;=%% ]"
":: [s0;=%% `@FU]"
"::|1 [s0; `@N]"
"::|1 [s0;= `@P]"
":: [s0; ]"
":: [s0;=%% `@DR]"
":: [s0;=%% ]"
":: [s0;=%% ]"
":: [s0;=%% ]"
":: [s0;=%% `@FR]"
":: [s0; ]"
":: [s0; ]"
"::|1 [s0;= `@CH]"
":: [s0;=%% `@D]"
":: [s0;=%% `@GS]"
":: [s0;=%% `@E]"
":: [s0;=%% ]"
":: [s0;=%% `@FU]"
"::|1 [s0; `@N]"
"::|1 [s0;= `@P]"
":: [s0; ]"
":: [s0;=%% `@DR]"
":: [s0;=%% ]"
":: [s0;=%% ]"
":: [s0;=%% ]"
":: [s0;=%% `@FR]"
":: [s0; ]"
":: [s0; ]"
"::@7 [s0;= [*2 Totals]]"
"::@2 [s0;=%% `@DT]"
":: [s0;=%% `@GA]"
":: [s0;=%% `@ET]"
":: [s0;=%% `-]"
":: [s0;=%% `@FT]"
":: [s0; `-]}}]";
Perform(r);
}

View file

@ -0,0 +1,9 @@
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
}

View file

@ -0,0 +1,9 @@
uses
Core;
file
alloctest.cpp;
mainconfig
"" = "";