00001 #include <gui/MessageBox.h>
00002 #include <gui/MessageQueue.h>
00003 #include <gui/Button.h>
00004 #include <gui/ToolTip.h>
00005 #include <gui/TopView.h>
00006 #include <gui/Exceptions.h>
00007 #include <gui/Window.h>
00008 #include <gui/StringView.h>
00009 #include <gui/ApplicationWindow.h>
00010 #include <gui/Application.h>
00011 #include <gui/Menu.h>
00012 #include <gui/StatusBar.h>
00013 #include <gui/ImageButton.h>
00014 #include <gui/CheckBox.h>
00015 #include <iostream>
00016 #include <gui/ImageLoader.h>
00017
00018
00019 using namespace SkyGI;
00020
00021 class MyImage : public View
00022 {
00023 public:
00024 MyImage(Window *pParent, const Rect &rFrame, unsigned int nWindowLayoutFlags);
00025 };
00026
00027
00028 MyImage::MyImage(Window *pParent, const Rect &rFrame, unsigned int nWindowLayoutFlags) : View(pParent, rFrame, nWindowLayoutFlags)
00029 {
00030 ImageButton *pImageButton;
00031
00032 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/bmp8.bmp"), WINDOW_LAYOUT_NOTHING);
00033 pImageButton->SetToolTip(new ToolTip("BMP 8Bpp"), 0);
00034 pImageButton->SetRect(Point(10, 10), Point(64, 64));
00035
00036 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/bmp24.bmp"), WINDOW_LAYOUT_NOTHING);
00037 pImageButton->SetToolTip(new ToolTip("BMP 24Bpp"), 0);
00038 pImageButton->SetRect(Point(110, 10), Point(64, 64));
00039
00040 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/bmp32.bmp"), WINDOW_LAYOUT_NOTHING);
00041 pImageButton->SetToolTip(new ToolTip("BMP 32Bpp"), 0);
00042 pImageButton->SetRect(Point(210, 10), Point(64, 64));
00043
00044 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/jpg.jpg"), WINDOW_LAYOUT_NOTHING);
00045 pImageButton->SetToolTip(new ToolTip("JPG"), 0);
00046 pImageButton->SetRect(Point(10, 110), Point(64, 64));
00047
00048 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/gif.gif"), WINDOW_LAYOUT_NOTHING);
00049 pImageButton->SetToolTip(new ToolTip("GIF"), 0);
00050 pImageButton->SetRect(Point(110, 110), Point(64, 64));
00051
00052 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/png.png"), WINDOW_LAYOUT_NOTHING);
00053 pImageButton->SetToolTip(new ToolTip("PNG"), 0);
00054 pImageButton->SetRect(Point(210, 110), Point(64, 64));
00055
00056 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/system/icons/actions/editcopy.ico"), WINDOW_LAYOUT_NOTHING);
00057 pImageButton->SetToolTip(new ToolTip("ICO, 32bit, nothing specified"), 0);
00058 pImageButton->SetRect(Point(10, 210), Point(64, 64));
00059
00060 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/system/icons/actions/editcopy.ico", Point(32,32)), WINDOW_LAYOUT_NOTHING);
00061 pImageButton->SetToolTip(new ToolTip("ICO, 32bit, 32x32"), 0);
00062 pImageButton->SetRect(Point(110, 210), Point(64, 64));
00063
00064 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/system/icons/actions/editcopy.ico", Point(0,0), 0, 1), WINDOW_LAYOUT_NOTHING);
00065 pImageButton->SetToolTip(new ToolTip("ICO, 32bit, Index 1"), 0);
00066 pImageButton->SetRect(Point(210, 210), Point(64, 64));
00067
00068 pImageButton = new ImageButton(this, Rect(0,0,0,0), ImageLoader::LoadImage("/boot/programs/testsuite/skygi/resource/ico.ico", Point(32,32)), WINDOW_LAYOUT_NOTHING);
00069 pImageButton->SetToolTip(new ToolTip("ICO, 24bit (AndMask), 32x32"), 0);
00070 pImageButton->SetRect(Point(110, 310), Point(64, 64));
00071 }
00072
00073 void ImagesTest()
00074 {
00075 Rect r(Point(100, 100), Point(400, 500));
00076
00077 ApplicationWindow* pApplicationWindow = new ApplicationWindow(r, "Image test", WINDOW_LAYOUT_NOTHING, APPLICATION_WINDOW_NO_VIEW);
00078
00079 pApplicationWindow->GetTitleWindow()->SetFlags( (TitleWindowFlags)(pApplicationWindow->GetTitleWindow()->GetFlags() ));
00080 pApplicationWindow->AttachView(new MyImage(pApplicationWindow, pApplicationWindow->GetClientRect(), WINDOW_LAYOUT_NOTHING));
00081 pApplicationWindow->Show();
00082 }
00083