Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

utils_controls.h

Go to the documentation of this file.
      00001 //----------------------------------------------------------------------------------------
      00011 // RCS-ID:      $Id: utils_controls.h,v 1.12 2002/09/28 18:01:28 robertoconnor Exp $
      00012 //----------------------------------------------------------------------------------------
      00013 
      00014 //----------------------------------------------------------------------------------------
      00015 // Begin single inclusion of this .h file condition
      00016 //----------------------------------------------------------------------------------------
      00017 
      00018 #ifndef _UTILS_CONTROLS_H_
      00019 #define _UTILS_CONTROLS_H_
      00020 
      00021 //----------------------------------------------------------------------------------------
      00022 // GCC interface
      00023 //----------------------------------------------------------------------------------------
      00024 
      00025 #if defined(__GNUG__) && ! defined(__APPLE__)
      00026     #pragma interface "utils_controls.h"
      00027 #endif
      00028 
      00029 //----------------------------------------------------------------------------------------
      00030 // Shared defines
      00031 //----------------------------------------------------------------------------------------
      00032 
      00033 #include "plucker_defines.h"
      00034 
      00035 //----------------------------------------------------------------------------------------
      00036 // Headers
      00037 //----------------------------------------------------------------------------------------
      00038 
      00039 #include "wx/splitter.h"            // wxSplitterWindow
      00040 #include "wx/html/htmlwin.h"        // wxHtmlWindow
      00041 #include "wx/settings.h"            // Enum of system colors
      00042 
      00043 //----------------------------------------------------------------------------------------
      00044 // Class option flags
      00045 //----------------------------------------------------------------------------------------
      00046 
      00048 enum
      00049 {
      00051     optionSET_HTML_BACKGROUND_TO_MATCH_GUI_PANEL = 1,
      00053     optionSET_HTML_BACKGROUND_TO_MATCH_GUI_LISTBOX = 2,
      00055     optionSET_HTML_FONT_COLOR_TO_MATCH_GUI = 4,
      00057     optionSET_HTML_FONT_FACE_AND_POINTSIZE_TO_MATCH_GUI = 8,
      00059     optionSET_HTML_WINDOW_INTERNAL_PADDING_TO_ZERO = 16
      00060 };
      00061 
      00062 //----------------------------------------------------------------------------------------
      00063 // Class definition: utils_controls (static only)
      00064 //----------------------------------------------------------------------------------------
      00065 
      00067 class utils_controls 
      00068 {
      00069 public:
      00070 
      00072 
      00076     static bool splitterwindow_fix_sash_out_of_range( wxSplitterWindow* splitterwindow );    
00077     
00079 
00086     static bool textctrl_hex_color_selection ( wxTextCtrl* target_color_textctrl );    
00087     
00089 
00107     static bool textctrl_filename_selection ( wxTextCtrl* target_filename_textctrl,
00108                                               wxString message,                           
00109                                               wxString default_file,
00110                                               wxString default_directory, 
00111                                               wxString wildcard,
00112                                               bool allow_multiple, 
00113                                               wxChar multiple_selection_delimiter,
00114                                               bool uses_file_protocol 
00115                                             );
00116     
00118 
00133     static bool textctrl_directory_selection( wxTextCtrl* target_filename_textctrl,        
00134                                                wxString message,
00135                                                wxString default_directory,
00136                                                bool allow_multiple,
00137                                                wxChar multiple_selection_delimiter
00138                                              );
00139 
00141 
00153     static void set_html_window_text_in_gui_style( wxHtmlWindow* target_html_window,        
00154                                    const wxString& source = wxEmptyString,
00155                                    long options = optionSET_HTML_BACKGROUND_TO_MATCH_GUI_PANEL        |
00156                                                   optionSET_HTML_FONT_COLOR_TO_MATCH_GUI              |
00157                                                   optionSET_HTML_FONT_FACE_AND_POINTSIZE_TO_MATCH_GUI |
00158                                                   optionSET_HTML_WINDOW_INTERNAL_PADDING_TO_ZERO 
00159                                    );
00160     
00162 
00167     static void set_choice_to_configuration_time_string( wxChoice* target_choice, 
00168                                     const wxString& time_configuration_key,
00169                                     const wxString& default_time_string = "12:00:00" 
00170                                     );
00171     
00173 
00177     static void set_configuration_time_string_to_choice_index( const wxString& time_configuration_key,
00178                                     wxChoice* input_choice 
00179                                     );
00180     
00182 
00190     static void read_dialog_position_and_size( wxWindow* target_window, 
00191                                     const wxString& configuration_key_basename,
00192                                     wxPoint default_position = wxDefaultPosition, 
00193                                     wxSize default_size = wxDefaultSize 
00194                                     );  
00195     
00197 
00203     static void write_dialog_position_and_size( wxWindow* target_window, 
00204                                      const wxString& configuration_key_basename );
00205                                              
00206 };
00207                                    
00208 // Defines to go with filename_selection wildcards when showing a file selection dialog
00213 #define FILE_DIALOG_WILDCARDS_ALL _( "All files  (*.*)|*.*" )
00214 #define FILE_DIALOG_WILDCARDS_IMAGES _( "Images (*.png, *.gif, *.jpg)|*.png;*.gif;*.jpg;*.jpeg|PNG files (*.png)|*.png|GIF files (*.gif)|*.gif|JPG files (*.jpg,*jpeg)|*.jpg;*.jpeg|All files  (*.*)|*.*" )
00215 #define FILE_DIALOG_WILDCARDS_HANDHELD_LAUNCHER_ICONS _( "Images (*.bmp, *.png, *.gif)|*.bmp;*.png;*.gif|Bitmaps (*.bmp)|*.bmp|PNG files (*.png)|*.png|GIF files (*.gif)|*.gif" )
00216 
00217 #ifdef __WXMSW__
00218     #define FILE_DIALOG_WILDCARDS_EXECUTABLES _( "Programs (*.exe)|*.exe" )
00219 #else    
00220     #define FILE_DIALOG_WILDCARDS_EXECUTABLES _( "Programs (*.*)|*.*" )
00221 #endif
00222 
00223 #define FILE_DIALOG_WILDCARDS_PLUCKABLES _( "All files  (*.*)|*.*|HTML, XML, Text files (*.html, *.htm, *.xml, *.txt)|*.html;*.htm;*.xml'*.txt|Images (*.png, *.gif, *.jpg)|*.png;*.gif;*.jpg;*.jpeg" )
00224 
00225 //----------------------------------------------------------------------------------------
00226 // End single inclusion of this .h file condition
00227 //----------------------------------------------------------------------------------------
00228     
00229 #endif  //_UTILS_CONTROLS_H_
00230