Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

OptionsLook.h

Go to the documentation of this file.
00001 #ifndef Impala_Visualization_OptionsLook_h
00002 #define Impala_Visualization_OptionsLook_h
00003 
00004 #ifndef OglGui_Window_h
00005 #include "OglGui/Window.h"
00006 #endif
00007 
00008 #ifndef Impala_Basis_CmdOptions_h
00009 #include "Basis/CmdOptions.h"
00010 #endif
00011 
00012 namespace Impala {
00013 namespace Visualization {
00014 
00015 void
00016 DoOptionsLook(OglGui::Window* wnd, String base)
00017 {
00018     if (base.empty())
00019         return;
00020 
00021     CmdOptions& options   = CmdOptions::GetInstance();
00022 
00023     int brdType = options.GetInt(base+"BorderType",10);
00024     if (brdType != 10)
00025         wnd->SetBorderType(brdType);
00026 
00027     std::string colStr = options.GetString(base+"Bg");
00028     if (!colStr.empty())
00029         wnd->SetBackground(OglColorStr(colStr.c_str()));
00030 
00031     std::string brdStr = options.GetString(base+"BorderBg");
00032     if (!brdStr.empty())
00033         wnd->SetBorderBackground(OglColorStr(brdStr.c_str()));
00034 
00035     int         colShade  = options.GetInt(base+"Shade",10);
00036     float       colShOpac = options.GetDouble(base+"ShadeOpacity",0.5);
00037     if (colShade != 10 && colShade != 0)
00038     {
00039         wnd->SetBorderFillShaded(colShade);
00040         wnd->SetBorderFillOpacity(colShOpac);
00041     }
00042 }
00043 
00044 void
00045 OptionsLook(OglGui::Window* wnd, String base, String special="")
00046 {
00047 
00048     CmdOptions& options = CmdOptions::GetInstance();
00049     if (!base.empty())
00050         DoOptionsLook(wnd, base);
00051     if (!special.empty())
00052         DoOptionsLook(wnd, special);
00053 }
00054 
00055 
00056 void OptionsLooks(OglGui::Window* wnd, String special="")
00057 {
00058     OGLWND* oglWnd = wnd->GetOGLWND();
00059     LIST    *obj;
00060 
00061 //    if (!special.empty())
00062 //        printf("Wnd %ld -> %s\n", wnd, special.c_str());
00063     if (!special.empty())
00064         OptionsLook(wnd,special);
00065     else
00066         OptionsLook(wnd, wnd->GuiGeneralName(), wnd->GuiName());
00067     for (obj=oglWnd->wndList; obj; obj = obj->next)
00068     {
00069         oglWnd = (OGLWND*) obj->info;
00070 
00071         OglGui::Window* child;
00072         if (child = (OglGui::Window*) OglGui::OglWindow::GetOglWindow(oglWnd))
00073         {
00074             if (!child->GuiName().empty())
00075                 OptionsLooks(child,child->GuiName());
00076             else
00077                 OptionsLooks(child);
00078             if (!special.empty())
00079             {
00080                 OptionsLooks(child,special);
00081                 if (!child->GuiGeneralName().empty()) // Note not recursing!!
00082                     OptionsLook(child, special + "." + child->GuiGeneralName());
00083                 if (!child->GuiName().empty())
00084                     OptionsLooks(child,special + "." + child->GuiName());
00085             }
00086         }
00087     }
00088 }
00089 /*
00090 void OptionsLooks(OglGui::Window* wnd, String special="")
00091 {
00092     OGLWND* oglWnd = wnd->GetOGLWND();
00093     LIST    *obj;
00094 
00095     if (special == "dataFileSelector.ScrollBar.Thumb")
00096         obj = 0;
00097     if (!special.empty())
00098         printf("Wnd %d -> %s\n", wnd, special.c_str());
00099     OptionsLook(wnd, wnd->GuiGeneralName(), wnd->GuiName());
00100     if (!special.empty())
00101         OptionsLook(wnd,special);
00102     for (obj=oglWnd->wndList; obj; obj = obj->next)
00103     {
00104         oglWnd = (OGLWND*) obj->info;
00105 
00106         OglGui::Window* child;
00107         if (child = (OglGui::Window*) OglWindow::GetOglWindow(oglWnd))
00108         {
00109             if (!child->GuiName().empty())
00110                 OptionsLooks(child,child->GuiName());
00111             else
00112                 OptionsLooks(child);
00113             if (!special.empty())
00114             {
00115                 OptionsLooks(child,special);
00116                 if (!child->GuiGeneralName().empty())
00117                     OptionsLooks(child,special + "." + child->GuiGeneralName());
00118                 if (!child->GuiName().empty())
00119                     OptionsLooks(child,special + "." + child->GuiName());
00120             }
00121         }
00122     }
00123 }
00124 */
00125 } // namaspace Visualization
00126 } // namespace Impala
00127 #endif

Generated on Fri Mar 19 09:31:50 2010 for ImpalaSrc by  doxygen 1.5.1