src/app/cn3d/preferences_dialog.cpp File Reference

#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include <corelib/ncbireg.hpp>
#include "remove_header_conflicts.hpp"
#include "preferences_dialog.hpp"
#include <algo/structure/wx_tools/wx_tools.hpp>
#include "opengl_renderer.hpp"
#include "cn3d_tools.hpp"
#include "messenger.hpp"
#include "cn3d_cache.hpp"
#include <wx/image.h>
#include <wx/statline.h>
#include <wx/spinbutt.h>
#include <wx/spinctrl.h>
#include <wx/splitter.h>
#include <wx/listctrl.h>
#include <wx/treectrl.h>
#include <wx/notebook.h>
#include <wx/grid.h>

Include dependency graph for preferences_dialog.cpp:

Go to the source code of this file.

Defines

#define ID_NOTEBOOK   10000
#define ID_B_DONE   10001
#define ID_B_CANCEL   10002
#define ID_TEXT   10003
#define ID_TEXTCTRL   10004
#define ID_SPINBUTTON   10005
#define ID_C_HIGHLIGHT   10006
#define ID_RADIOBOX   10007
#define ID_B_Q_LOW   10008
#define ID_B_Q_MED   10009
#define ID_B_Q_HIGH   10010
#define ID_C_CACHE_ON   10011
#define ID_LINE   10012
#define ID_T_CACHE_1   10013
#define ID_B_CACHE_BROWSE   10014
#define ID_T_CACHE_FOLDER   10015
#define ID_T_CACHE_2   10016
#define ID_B_CACHE_CLEAR   10017
#define ID_C_ANNOT_RO   10018
#define ID_T_LAUNCH   10019
#define ID_T_NSTRUCT   10020
#define ID_T_FOOT   10021
#define ID_T_SEPARATION   10022
#define ID_C_PROXIMAL   10023
#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type)
#define SET_ISPINCTRL_FROM_REGISTRY_VALUE(section, name, iSpinCtrl)
#define SET_FSPINCTRL_FROM_REGISTRY_VALUE(section, name, fSpinCtrl)
#define SET_CHECKBOX_FROM_REGISTRY_VALUE(section, name, id)
#define SET_RADIOBOX_FROM_REGISTRY_VALUE(section, name, id)
#define SET_TEXTCTRL_FROM_REGISTRY_VALUE(section, name, id)
#define SET_INTEGER_REGISTRY_VALUE_IF_DIFFERENT(section, name, iSpinCtrl, changedPtr)
#define SET_DOUBLE_REGISTRY_VALUE_IF_DIFFERENT(section, name, fSpinCtrl, changedPtr)
#define SET_BOOL_REGISTRY_VALUE_IF_DIFFERENT(section, name, id, changedPtr)
#define SET_RADIO_REGISTRY_VALUE_IF_DIFFERENT(section, name, id, changedPtr)
#define SET_STRING_REGISTRY_VALUE_IF_DIFFERENT(section, name, textCtrl)

Functions

wxSizer * SetupPreferencesNotebook (wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
wxSizer * SetupQualityPage (wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
wxSizer * SetupCachePage (wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
wxSizer * SetupAdvancedPage (wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
 USING_SCOPE (Cn3D)

Variables

 USING_NCBI_SCOPE
static IntegerSpinCtrlgiWormSegments
static IntegerSpinCtrlgiWormSides
static IntegerSpinCtrlgiBondSides
static IntegerSpinCtrlgiHelixSides
static IntegerSpinCtrlgiAtomSlices
static IntegerSpinCtrlgiAtomStacks
static IntegerSpinCtrlgiCacheSize
static IntegerSpinCtrlgiMaxStructs
static IntegerSpinCtrlgiFootRes
static FloatingPointSpinCtrlgfSeparation


Define Documentation

#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR var,
id,
type   ) 
 

Value:

type *var; \
    var = wxDynamicCast(FindWindow(id), type); \
    if (!var) { \
        ERRORMSG("Can't find window with id " << id); \
        return; \
    }

Definition at line 108 of file preferences_dialog.cpp.

#define ID_B_CACHE_BROWSE   10014
 

Definition at line 82 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), and SetupCachePage().

#define ID_B_CACHE_CLEAR   10017
 

Definition at line 85 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), and SetupCachePage().

#define ID_B_CANCEL   10002
 

Definition at line 66 of file preferences_dialog.cpp.

#define ID_B_DONE   10001
 

Definition at line 65 of file preferences_dialog.cpp.

#define ID_B_Q_HIGH   10010
 

Definition at line 76 of file preferences_dialog.cpp.

Referenced by SetupQualityPage().

#define ID_B_Q_LOW   10008
 

Definition at line 74 of file preferences_dialog.cpp.

Referenced by SetupQualityPage().

#define ID_B_Q_MED   10009
 

Definition at line 75 of file preferences_dialog.cpp.

Referenced by SetupQualityPage().

#define ID_C_ANNOT_RO   10018
 

Definition at line 88 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupAdvancedPage().

#define ID_C_CACHE_ON   10011
 

Definition at line 79 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupCachePage().

#define ID_C_HIGHLIGHT   10006
 

Definition at line 72 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

#define ID_C_PROXIMAL   10023
 

Definition at line 93 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupAdvancedPage().

#define ID_LINE   10012
 

Definition at line 80 of file preferences_dialog.cpp.

#define ID_NOTEBOOK   10000
 

Definition at line 64 of file preferences_dialog.cpp.

Referenced by LayoutNotebook(), and SetupPreferencesNotebook().

#define ID_RADIOBOX   10007
 

Definition at line 73 of file preferences_dialog.cpp.

#define ID_SPINBUTTON   10005
 

Definition at line 71 of file preferences_dialog.cpp.

#define ID_T_CACHE_1   10013
 

Definition at line 81 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), and SetupCachePage().

#define ID_T_CACHE_2   10016
 

Definition at line 84 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), and SetupCachePage().

#define ID_T_CACHE_FOLDER   10015
 

Definition at line 83 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCheckbox(), PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupCachePage().

#define ID_T_FOOT   10021
 

Definition at line 91 of file preferences_dialog.cpp.

#define ID_T_LAUNCH   10019
 

Definition at line 89 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow(), PreferencesDialog::PreferencesDialog(), and SetupAdvancedPage().

#define ID_T_NSTRUCT   10020
 

Definition at line 90 of file preferences_dialog.cpp.

#define ID_T_SEPARATION   10022
 

Definition at line 92 of file preferences_dialog.cpp.

#define ID_TEXT   10003
 

Definition at line 69 of file preferences_dialog.cpp.

#define ID_TEXTCTRL   10004
 

Definition at line 70 of file preferences_dialog.cpp.

#define SET_BOOL_REGISTRY_VALUE_IF_DIFFERENT section,
name,
id,
changedPtr   ) 
 

Value:

do { \
        bool oldValue, newValue; \
        if (!RegistryGetBoolean((section), (name), &oldValue)) throw "RegistryGetBoolean() failed"; \
        wxCheckBox *box = wxDynamicCast(FindWindow(id), wxCheckBox); \
        if (!box) throw "Can't get wxCheckBox*"; \
        newValue = box->GetValue(); \
        if (newValue != oldValue) { \
            if (!RegistrySetBoolean((section), (name), newValue, true)) \
                throw "RegistrySetBoolean() failed"; \
            if (changedPtr) *((bool*) changedPtr) = true; \
        } \
    } while (0)

Definition at line 255 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow().

#define SET_CHECKBOX_FROM_REGISTRY_VALUE section,
name,
id   ) 
 

Value:

do { \
        bool on; \
        wxCheckBox *box = wxDynamicCast(FindWindow(id), wxCheckBox); \
        if (!box || !RegistryGetBoolean((section), (name), &on)) \
            WARNINGMSG("PreferencesDialog::PreferencesDialog() - error with " << (name)); \
        else \
            box->SetValue(on); \
    } while (0)

Definition at line 136 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog().

#define SET_DOUBLE_REGISTRY_VALUE_IF_DIFFERENT section,
name,
fSpinCtrl,
changedPtr   ) 
 

Value:

do { \
        double oldValue, newValue; \
        if (!RegistryGetDouble((section), (name), &oldValue)) throw "RegistryGetInteger() failed"; \
        if (!((fSpinCtrl)->GetDouble(&newValue))) throw "GetInteger() failed"; \
        if (newValue != oldValue) { \
            if (!RegistrySetDouble((section), (name), newValue)) \
                throw "RegistrySetInteger() failed"; \
            if (changedPtr) *((bool*) changedPtr) = true; \
        } \
    } while (0)

Definition at line 243 of file preferences_dialog.cpp.

#define SET_FSPINCTRL_FROM_REGISTRY_VALUE section,
name,
fSpinCtrl   ) 
 

Value:

do { \
        double value; \
        if (!RegistryGetDouble((section), (name), &value) || !((fSpinCtrl)->SetDouble(value))) \
            WARNINGMSG("PreferencesDialog::PreferencesDialog() - error with " << (name)); \
    } while (0)

Definition at line 129 of file preferences_dialog.cpp.

#define SET_INTEGER_REGISTRY_VALUE_IF_DIFFERENT section,
name,
iSpinCtrl,
changedPtr   ) 
 

Value:

do { \
        int oldValue, newValue; \
        if (!RegistryGetInteger((section), (name), &oldValue)) throw "RegistryGetInteger() failed"; \
        if (!((iSpinCtrl)->GetInteger(&newValue))) throw "GetInteger() failed"; \
        if (newValue != oldValue) { \
            if (!RegistrySetInteger((section), (name), newValue)) \
                throw "RegistrySetInteger() failed"; \
            if (changedPtr) *((bool*) changedPtr) = true; \
        } \
    } while (0)

Definition at line 231 of file preferences_dialog.cpp.

#define SET_ISPINCTRL_FROM_REGISTRY_VALUE section,
name,
iSpinCtrl   ) 
 

Value:

do { \
        int value; \
        if (!RegistryGetInteger((section), (name), &value) || !((iSpinCtrl)->SetInteger(value))) \
            WARNINGMSG("PreferencesDialog::PreferencesDialog() - error with " << (name)); \
    } while (0)

Definition at line 122 of file preferences_dialog.cpp.

#define SET_RADIO_REGISTRY_VALUE_IF_DIFFERENT section,
name,
id,
changedPtr   ) 
 

Value:

do { \
        string oldValue, newValue; \
        if (!RegistryGetString((section), (name), &oldValue)) throw "RegistryGetString() failed"; \
        wxRadioBox *radio = wxDynamicCast(FindWindow(id), wxRadioBox); \
        if (!radio) throw "Can't get wxRadioBox*"; \
        newValue = radio->GetStringSelection().c_str(); \
        if (newValue != oldValue) { \
            if (!RegistrySetString((section), (name), newValue)) \
                throw "RegistrySetString() failed"; \
            if (changedPtr) *((bool*) changedPtr) = true; \
        } \
    } while (0)

Definition at line 269 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow().

#define SET_RADIOBOX_FROM_REGISTRY_VALUE section,
name,
id   ) 
 

Value:

do { \
        string value; \
        wxRadioBox *radio = wxDynamicCast(FindWindow(id), wxRadioBox); \
        if (!radio || !RegistryGetString((section), (name), &value)) \
            WARNINGMSG("PreferencesDialog::PreferencesDialog() - error with " << (name)); \
        else \
            radio->SetStringSelection(value.c_str()); \
    } while (0)

Definition at line 146 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog().

#define SET_STRING_REGISTRY_VALUE_IF_DIFFERENT section,
name,
textCtrl   ) 
 

Value:

do { \
        string oldValue, newValue; \
        if (!RegistryGetString((section), (name), &oldValue)) throw "RegistryGetString() failed"; \
        newValue = (textCtrl)->GetValue().c_str(); \
        if (newValue != oldValue) { \
            if (!RegistrySetString((section), (name), newValue)) \
                throw "RegistrySetString() failed"; \
        } \
    } while (0)

Definition at line 283 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::OnCloseWindow().

#define SET_TEXTCTRL_FROM_REGISTRY_VALUE section,
name,
id   ) 
 

Value:

do { \
        string value; \
        wxTextCtrl *text = wxDynamicCast(FindWindow(id), wxTextCtrl); \
        if (!text || !RegistryGetString((section), (name), &value)) \
            WARNINGMSG("PreferencesDialog::PreferencesDialog() - error with " << (name)); \
        else \
            text->SetValue(value.c_str()); \
    } while (0)

Definition at line 156 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog().


Function Documentation

wxSizer * SetupAdvancedPage wxWindow *  parent,
bool  call_fit = TRUE,
bool  set_sizer = TRUE
 

Definition at line 489 of file preferences_dialog.cpp.

References IntegerSpinCtrl::GetSpinButton(), IntegerSpinCtrl::GetTextCtrl(), giFootRes, giMaxStructs, ID_C_ANNOT_RO, ID_C_PROXIMAL, ID_T_LAUNCH, ID_TEXT, and TRUE.

Referenced by SetupPreferencesNotebook().

wxSizer * SetupCachePage wxWindow *  parent,
bool  call_fit = TRUE,
bool  set_sizer = TRUE
 

Definition at line 704 of file preferences_dialog.cpp.

References IntegerSpinCtrl::GetSpinButton(), IntegerSpinCtrl::GetTextCtrl(), giCacheSize, ID_B_CACHE_BROWSE, ID_B_CACHE_CLEAR, ID_C_CACHE_ON, ID_LINE, ID_T_CACHE_1, ID_T_CACHE_2, ID_T_CACHE_FOLDER, and TRUE.

Referenced by SetupPreferencesNotebook().

wxSizer * SetupPreferencesNotebook wxWindow *  parent,
bool  call_fit = TRUE,
bool  set_sizer = TRUE
 

Definition at line 438 of file preferences_dialog.cpp.

References FALSE, ID_B_CANCEL, ID_B_DONE, ID_NOTEBOOK, SetupAdvancedPage(), SetupCachePage(), SetupQualityPage(), and TRUE.

Referenced by PreferencesDialog::PreferencesDialog().

wxSizer * SetupQualityPage wxWindow *  parent,
bool  call_fit = TRUE,
bool  set_sizer = TRUE
 

Definition at line 579 of file preferences_dialog.cpp.

References IntegerSpinCtrl::GetSpinButton(), IntegerSpinCtrl::GetTextCtrl(), giAtomSlices, giAtomStacks, giBondSides, giHelixSides, giWormSegments, giWormSides, ID_B_Q_HIGH, ID_B_Q_LOW, ID_B_Q_MED, ID_C_HIGHLIGHT, ID_RADIOBOX, ID_TEXT, and TRUE.

Referenced by SetupPreferencesNotebook().

USING_SCOPE Cn3D   ) 
 


Variable Documentation

FloatingPointSpinCtrl* gfSeparation [static]
 

Definition at line 106 of file preferences_dialog.cpp.

IntegerSpinCtrl * giAtomSlices [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

IntegerSpinCtrl * giAtomStacks [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

IntegerSpinCtrl * giBondSides [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

IntegerSpinCtrl * giCacheSize [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupCachePage().

IntegerSpinCtrl * giFootRes [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupAdvancedPage().

IntegerSpinCtrl * giHelixSides [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

IntegerSpinCtrl * giMaxStructs [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupAdvancedPage().

IntegerSpinCtrl* giWormSegments [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

IntegerSpinCtrl * giWormSides [static]
 

Definition at line 104 of file preferences_dialog.cpp.

Referenced by PreferencesDialog::PreferencesDialog(), and SetupQualityPage().

USING_NCBI_SCOPE
 

Definition at line 98 of file preferences_dialog.cpp.


Generated on Wed Dec 9 07:42:34 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:18:32 2009 by modify_doxy.py rev. 173732