mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9f782ba5
commit
4a1c627474
2823 changed files with 619073 additions and 0 deletions
21
uppdev/PictureBugTest/PictureBugTest.h
Normal file
21
uppdev/PictureBugTest/PictureBugTest.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef _PictureBugTest_PictureBugTest_h
|
||||
#define _PictureBugTest_PictureBugTest_h
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#define LAYOUTFILE <PictureBugTest/PictureBugTest.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
|
||||
|
||||
class PictureBugTest : public WithPictureBugTestLayout<TopWindow> {
|
||||
public:
|
||||
typedef PictureBugTest CLASSNAME;
|
||||
PictureBugTest();
|
||||
void Open();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
5
uppdev/PictureBugTest/PictureBugTest.lay
Normal file
5
uppdev/PictureBugTest/PictureBugTest.lay
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
LAYOUT(PictureBugTestLayout, 200, 108)
|
||||
ITEM(Picture, pict, SetFrame(FieldFrame()).HSizePosZ(8, 76).VSizePosZ(8, 8))
|
||||
ITEM(Button, open, SetLabel(t_("Open...")).RightPosZ(4, 60).TopPosZ(8, 24))
|
||||
END_LAYOUT
|
||||
|
||||
12
uppdev/PictureBugTest/PictureBugTest.upp
Normal file
12
uppdev/PictureBugTest/PictureBugTest.upp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
plugin\jpg;
|
||||
|
||||
file
|
||||
PictureBugTest.h,
|
||||
main.cpp,
|
||||
PictureBugTest.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
42
uppdev/PictureBugTest/main.cpp
Normal file
42
uppdev/PictureBugTest/main.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#include "PictureBugTest.h"
|
||||
|
||||
|
||||
|
||||
PictureBugTest::PictureBugTest()
|
||||
{
|
||||
CtrlLayout(*this, "Window title");
|
||||
Sizeable();
|
||||
open <<= THISBACK(Open);
|
||||
|
||||
pict.KeepRatio();
|
||||
}
|
||||
|
||||
void PictureBugTest::Open()
|
||||
{
|
||||
FileSelector fs;
|
||||
fs
|
||||
.Type(t_("Pictures (*.png; *.bmp; *.jpg)"), "*.png;*.bmp;*.jpg")
|
||||
.AllFilesType()
|
||||
;
|
||||
if(!fs.ExecuteOpen())
|
||||
return;
|
||||
String filename = fs;
|
||||
|
||||
Image img = StreamRaster::LoadFileAny(filename);
|
||||
if(img.IsEmpty())
|
||||
{
|
||||
Exclamation(t_("File is not an image file!"));
|
||||
return;
|
||||
}
|
||||
|
||||
DrawingDraw d( img.GetWidth(), img.GetHeight());
|
||||
d.DrawImage(0,0, img.GetWidth(), img.GetHeight(), img);
|
||||
pict.Set(d);
|
||||
}
|
||||
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
PictureBugTest().Run();
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue