Adding uppdev....

git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-08-15 08:36:24 +00:00
commit 4a1c627474
2823 changed files with 619073 additions and 0 deletions

View 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

View 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

View file

@ -0,0 +1,12 @@
uses
CtrlLib,
plugin\jpg;
file
PictureBugTest.h,
main.cpp,
PictureBugTest.lay;
mainconfig
"" = "GUI";

View 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();
}