00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef RANDOMIMAGEMODULE_H_
00011 #define RANDOMIMAGEMODULE_H_
00012
00013 #include "OglGui/GroupBox.h"
00014 #include "OglGui/Window.h"
00015
00016 #include "../OglImageCacheStore.h"
00017
00018 #include "RandomImageWindow.h"
00019
00020 namespace Impala { namespace Application { namespace MediaTable {
00021
00022 class RandomImageModule : public VisualizationModule
00023 {
00024 public:
00025 typedef OglGui::DocScroller DocScroller;
00026
00027 RandomImageModule() : VisualizationModule("RandomImage")
00028 {
00029 }
00030
00031 void ButtonSelectionEvent(OglGui::Button *src, void *userData)
00032 {
00033 if(src->GetLabel() == "New " + GetName())
00034 {
00035 StoreConfigWindowValues();
00036 DoHandleNewWindow(GetName(), mConfigWindow);
00037 delete mConfigWindow;
00038 DoReleaseConfigWindow();
00039 }
00040 else
00041 VisualizationModule::ButtonSelectionEvent(src, userData);
00042 }
00043
00044 void ViewSelected() {
00045 VisualizationModule::DrawConfigWindow();
00046 OglGui::GroupBox* grp = new OglGui::GroupBox(mConfigWindow, mConfigWindow->W()-2, 362, "");
00047
00048 AddSelectorWithColumnsOfType(grp, "Image", mStringValues["View"],
00049 TableDataSource::TYPE_FLAG_IMAGE, true);
00050 (new OglGui::Button(grp, grp->W()-4, 26, "New "+GetName(), BEV_ETCHED))
00051 ->SetButtonListener(this);
00052
00053 grp->RepositionViewports();
00054 grp->ScaleChildren();
00055 }
00056
00057 void NewWindow(OglGui::Window* window)
00058 {
00059 ILOG_DEBUG("Creating new RandomImageWindow.");
00060 TableDataView* mView;
00061 mView = TableDataStore::GetInstance()->GetTableDataView(mStringValues["View"]);
00062 RandomImageWindow* wnd =
00063 new RandomImageWindow(window,
00064 mView, mStringValues["Image"],
00065 0, 0, window->W(), window->H());
00066
00067 wnd->SetGetOglImageByIdInterface(this);
00068 wnd->SetOglImageCache(OglImageCacheStore::GetInstance());
00069
00070 window->ScaleChildren();
00071 window->SetBackground(oglGUI_BG);
00072 }
00073 protected:
00074 ILOG_VAR_DEC;
00075 };
00076
00077 ILOG_VAR_INIT(RandomImageModule, Application.MediaTable);
00078
00079 } } }
00080
00081 #endif // RANDOMIMAGEMODULE_H_