mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
.upptst
git-svn-id: svn://ultimatepp.org/upp/trunk@13013 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
311d570d4a
commit
30e164af52
10 changed files with 167 additions and 0 deletions
17
upptst/ArrayCtrlActions/ArrayCtrlActions.h
Normal file
17
upptst/ArrayCtrlActions/ArrayCtrlActions.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef _ArrayCtrlActions_ArrayCtrlActions_h
|
||||
#define _ArrayCtrlActions_ArrayCtrlActions_h
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <ArrayCtrlActions/ArrayCtrlActions.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
class ArrayCtrlActions : public WithArrayCtrlActionsLayout<TopWindow> {
|
||||
public:
|
||||
typedef ArrayCtrlActions CLASSNAME;
|
||||
ArrayCtrlActions();
|
||||
};
|
||||
|
||||
#endif
|
||||
5
upptst/ArrayCtrlActions/ArrayCtrlActions.lay
Normal file
5
upptst/ArrayCtrlActions/ArrayCtrlActions.lay
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
LAYOUT(ArrayCtrlActionsLayout, 348, 248)
|
||||
ITEM(ArrayCtrl, list, LeftPosZ(4, 188).TopPosZ(0, 244))
|
||||
ITEM(ArrayCtrl, action, LeftPosZ(196, 150).TopPosZ(0, 244))
|
||||
END_LAYOUT
|
||||
|
||||
11
upptst/ArrayCtrlActions/ArrayCtrlActions.upp
Normal file
11
upptst/ArrayCtrlActions/ArrayCtrlActions.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
ArrayCtrlActions.h,
|
||||
main.cpp,
|
||||
ArrayCtrlActions.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
27
upptst/ArrayCtrlActions/main.cpp
Normal file
27
upptst/ArrayCtrlActions/main.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "ArrayCtrlActions.h"
|
||||
|
||||
ArrayCtrlActions::ArrayCtrlActions()
|
||||
{
|
||||
CtrlLayout(*this, "Window title");
|
||||
|
||||
action.AddColumn("Action");
|
||||
|
||||
list.AddColumn("List");
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
list.Add(i);
|
||||
|
||||
list.Removing();
|
||||
list.Inserting();
|
||||
|
||||
auto Log = [=](const char *s) { action.Add(String() << action.GetCount() << ": " << s); action.GoEnd(); };
|
||||
list.WhenAction << [=] { Log("WhenAction"); };
|
||||
list.WhenArrayAction << [=] { Log("WhenArrayAction"); };
|
||||
list.WhenCursor << [=] { Log("WhenCursor"); };
|
||||
list.WhenSel << [=] { Log("WhenSel"); };
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
ArrayCtrlActions().Run();
|
||||
}
|
||||
9
upptst/DefaultInk/DefaultInk.upp
Normal file
9
upptst/DefaultInk/DefaultInk.upp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
18
upptst/DefaultInk/main.cpp
Normal file
18
upptst/DefaultInk/main.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
struct MyApp : TopWindow {
|
||||
virtual void Paint(Draw& w);
|
||||
};
|
||||
|
||||
void MyApp::Paint(Draw& w)
|
||||
{
|
||||
w.DrawRect(GetSize(), SColorPaper());
|
||||
w.DrawText(0, 0, "Hello world");
|
||||
}
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
MyApp().Run();
|
||||
}
|
||||
13
upptst/ImlUHDDark/ImlUHDDark.upp
Normal file
13
upptst/ImlUHDDark/ImlUHDDark.upp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
description "Testing .iml management for UHD / Dark modes\377";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
main.cpp,
|
||||
Test.iml,
|
||||
TestHD.iml;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
23
upptst/ImlUHDDark/Test.iml
Normal file
23
upptst/ImlUHDDark/Test.iml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
PREMULTIPLIED
|
||||
IMAGE_ID(Test1)
|
||||
IMAGE_ID(Test2)
|
||||
IMAGE_ID(Test2__DARK)
|
||||
IMAGE_ID(Test2__UHD__DARK)
|
||||
IMAGE_ID(Test2__UHD)
|
||||
IMAGE_ID(Test3)
|
||||
|
||||
IMAGE_BEGIN_DATA
|
||||
IMAGE_DATA(120,156,237,154,221,13,194,48,12,132,59,66,71,232,56,140,192,184,29,129,141,10,226,169,84,137,99,159,237,179,80,19)
|
||||
IMAGE_DATA(145,151,196,190,239,242,103,33,196,190,46,235,210,105,135,162,75,205,147,47,197,161,115,26,134,54,183,165,225,205,183,230)
|
||||
IMAGE_DATA(74,26,213,249,222,245,71,236,63,114,254,222,57,41,142,249,126,70,58,205,182,207,98,48,139,65,66,254,44,6,127,88)
|
||||
IMAGE_DATA(12,94,189,98,112,28,159,207,160,139,14,28,249,82,28,58,167,97,104,115,91,26,222,124,107,174,164,81,157,239,93,127)
|
||||
IMAGE_DATA(196,254,35,231,239,157,211,174,45,251,253,140,116,122,177,207,109,217,52,154,144,97,88,216,201,205,242,97,229,70,250,176)
|
||||
IMAGE_DATA(106,70,123,64,117,34,248,209,254,217,108,84,43,251,14,107,98,50,222,241,72,159,93,67,44,222,50,248,103,14,131,45)
|
||||
IMAGE_DATA(177,42,249,172,189,111,241,217,236,145,135,201,191,55,191,226,254,95,199,152,124,105,172,138,95,81,255,25,30,180,250,85)
|
||||
IMAGE_DATA(223,63,178,60,160,90,222,243,136,56,79,84,35,234,46,89,234,84,102,77,147,180,89,181,180,146,173,245,130,104,61,92)
|
||||
IMAGE_DATA(63,6,124,189,244,59,44,236,228,102,249,176,114,35,125,88,53,163,61,160,58,17,252,104,255,108,54,170,149,125,135,53)
|
||||
IMAGE_DATA(49,25,239,120,164,207,174,33,22,111,25,252,51,135,193,150,88,149,124,214,222,183,248,108,246,200,195,228,223,155,95,113)
|
||||
IMAGE_DATA(255,175,99,76,190,52,86,197,175,168,255,12,15,90,253,12,15,86,205,72,15,168,150,247,60,34,206,19,213,136,186,75)
|
||||
IMAGE_DATA(150,58,149,89,211,36,109,86,45,173,100,107,189,32,90,243,63,131,191,177,218,220,150,134,55,223,154,43,105,84,231,123)
|
||||
IMAGE_DATA(215,31,177,255,200,249,123,231,164,56,230,251,25,233,52,219,27,64,116,169,110,0,0,0,0,0,0,0,0,0,0,0)
|
||||
IMAGE_END_DATA(416, 6)
|
||||
10
upptst/ImlUHDDark/TestHD.iml
Normal file
10
upptst/ImlUHDDark/TestHD.iml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
PREMULTIPLIED
|
||||
IMAGE_ID(Test3)
|
||||
|
||||
IMAGE_BEGIN_DATA
|
||||
IMAGE_DATA(120,156,237,148,65,14,128,32,16,3,121,10,255,127,133,63,83,143,134,152,133,45,109,247,160,6,47,196,204,52,178,244)
|
||||
IMAGE_DATA(232,173,55,244,57,239,21,189,48,120,211,171,202,145,245,50,115,100,153,236,12,40,135,225,103,231,119,187,81,150,122,134)
|
||||
IMAGE_DATA(87,190,81,220,227,25,223,221,33,153,108,10,255,211,227,112,71,174,74,191,235,223,191,249,221,238,89,134,223,255,109,127)
|
||||
IMAGE_DATA(197,252,143,123,78,127,180,87,229,175,232,127,71,134,85,190,34,67,150,201,204,128,178,118,207,131,113,158,40,131,53,75)
|
||||
IMAGE_DATA(153,158,82,118,90,196,118,117,105,165,123,53,11,194,186,0,4,35,255,16,0,0,0,0,0,0,0,0,0,0,0,0)
|
||||
IMAGE_END_DATA(160, 1)
|
||||
34
upptst/ImlUHDDark/main.cpp
Normal file
34
upptst/ImlUHDDark/main.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define IMAGECLASS TestImg
|
||||
#define IMAGEFILE <ImlUHDDark/Test.iml>
|
||||
#include <Draw/iml_header.h>
|
||||
|
||||
#define IMAGECLASS TestImg
|
||||
#define IMAGEFILE <ImlUHDDark/Test.iml>
|
||||
#define IMAGEFILE_UHD <ImlUHDDark/TestHD.iml>
|
||||
#include <Draw/iml_source.h>
|
||||
|
||||
struct Test : TopWindow {
|
||||
virtual void Paint(Draw& w) {
|
||||
Size sz = GetSize();
|
||||
int x = 0;
|
||||
for(int mode = 0; mode < 4; mode++) {
|
||||
SColorPaper_Write(mode & 1 ? Black() : White());
|
||||
SetUHDMode(mode & 2);
|
||||
w.DrawRect(x, 0, sz.cx, sz.cy, SColorPaper());
|
||||
int y = 0;
|
||||
w.DrawImage(x + 10, y += 40, TestImg::Test1());
|
||||
w.DrawImage(x + 10, y += 40, TestImg::Test2());
|
||||
w.DrawImage(x + 10, y += 40, TestImg::Test3());
|
||||
x += 100;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
Test().Run();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue