Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4031 in orxonox.OLD for orxonox/trunk/src/lib/gui


Ignore:
Timestamp:
May 4, 2005, 12:42:27 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: rc now also part of gui-code

Location:
orxonox/trunk/src/lib/gui/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui/orxonox_gui_gtk.cc

    r4030 r4031  
    5050#endif /* HAVE_GTHREAD */
    5151  gtk_init(&argc, &argv);
    52   gtk_rc_parse( "rc" );
     52
     53#include "rc"
     54  gtk_rc_parse_string( rc_string );
    5355#endif /* HAVE_GTK2 */
    5456}
  • orxonox/trunk/src/lib/gui/gui/rc

    r3423 r4031  
    1 # pixmap_path "<dir 1>:<dir 2>:<dir 3>:..."
    2 #
    3 pixmap_path "/usr/include/X11R6/pixmaps:/home/imain/pixmaps"
    4 #
    5 # style <name> [= <name>]
    6 # {
    7 #   <option>
    8 # }
    9 #
    10 # widget <widget_set> style <style_name>
    11 # widget_class <widget_class_set> style <style_name>
     1static const gchar* rc_string =
     2(       
     3"style'window'"
     4"{"                     
     5"bg[NORMAL] = { 0, 0, 0 }"
     6"fg[NORMAL] = { 0, 1.0, 0 }"
     7"base[NORMAL] = { 0, 0, 0 }"
     8"base[INSENSITIVE] = { 0, 0, 0 }"
     9"}"
    1210
    13 # Here is a list of all the possible states.  Note that some do not apply to
    14 # certain widgets.
    15 #
    16 # NORMAL - The normal state of a widget, without the mouse over top of
    17 # it, and not being pressed, etc.
    18 #
    19 # PRELIGHT - When the mouse is over top of the widget, colors defined
    20 # using this state will be in effect.
    21 #
    22 # ACTIVE - When the widget is pressed or clicked it will be active, and
    23 # the attributes assigned by this tag will be in effect.
    24 #
    25 # INSENSITIVE - When a widget is set insensitive, and cannot be
    26 # activated, it will take these attributes.
    27 #
    28 # SELECTED - When an object is selected, it takes these attributes.
    29 #
    30 # Given these states, we can set the attributes of the widgets in each of
    31 # these states using the following directives.
    32 #
    33 # fg - Sets the foreground color of a widget.
    34 # bg - Sets the background color of a widget.
    35 # bg_pixmap - Sets the background of a widget to a tiled pixmap.
    36 # font - Sets the font to be used with the given widget.
    37 #
     11"style'scale'"
     12"{"
     13"fg[NORMAL] = { 0, 1.0, 0 }"
     14"bg[NORMAL] = { 0, 1.0, 0 }"
     15"bg[INSENSITIVE] = { 0, 1.0, 0 }"
     16"bg[PRELIGHT] = { 0, 1.0, 0 }"
     17"bg[ACTIVE] =   {0.2, 0.2, 0.2 }"
     18"}"
    3819
    39 # This sets a style called "button".  The name is not really important, as
    40 # it is assigned to the actual widgets at the bottom of the file.
     20"style'button'"
     21"{"
     22"fg[PRELIGHT] = { 0, 0, 0 }"
     23"bg[PRELIGHT] = { 0, 1.0, 0 }"
     24"bg[ACTIVE] = { 0, 1.0, 0 }"
     25"fg[ACTIVE] = { 0, 1.0, 0 }"
     26"bg[NORMAL] = { 0, 0, 0 }"
     27"fg[NORMAL] = { 0, 1.0, 0 }"
     28"bg[INSENSITIVE] = { 1.0, 0, 1.0 }"
     29"fg[INSENSITIVE] = { 1.0, 0, 1.0 }"
     30"base[NORMAL] = { 0, 1.0, 0 }"
     31"base[PRELIGHT] = { 0, 1.0, 0 }"
     32"}"
    4133
    42 style "window"
    43 {
    44   #This sets the padding around the window to the pixmap specified.
    45   #bg_pixmap[<STATE>] = "<pixmap filename>"
    46   #bg_pixmap[NORMAL] = "warning.xpm"
    47   bg[NORMAL] = { 0, 0, 0 }
    48   fg[NORMAL] = { 0, 1.0, 0 }
    49   base[NORMAL] = { 0, 0, 0 }
    50   base[INSENSITIVE] = { 0, 0, 0 }
    51 }
     34"style'main_button' = 'button'"
     35"{"
     36"font = '-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*'"
     37"bg[PRELIGHT] = { 0, 0.75, 0 }"
     38"}"
    5239
    53 style "scale"
    54 {
    55   #Sets the foreground color (font color) to red when in the "NORMAL"
    56   #state.
    57  
    58   fg[NORMAL] = { 0, 1.0, 0 }
    59   bg[NORMAL] = { 0, 1.0, 0 }
    60   bg[INSENSITIVE] = { 0, 1.0, 0 }
    61   bg[PRELIGHT] = { 0, 1.0, 0 }
    62   bg[ACTIVE] =   {0.2, 0.2, 0.2 }
    63  
    64   #Sets the background pixmap of this widget to that of its parent.
    65   bg_pixmap[NORMAL] = "<parent>"
    66 }
     40"style'toggle_button' = 'button'"
     41"{"
     42"fg[NORMAL] = { 0, 1.0, 0 }"
     43"fg[ACTIVE] = { 0, 1.0, 0 }"
     44"text[NORMAL] = { 0, 0, 0}"
     45"}"
    6746
    68 style "button"
    69 {
    70   # This shows all the possible states for a button.  The only one that
    71   # doesn't apply is the SELECTED state.
    72  
    73   fg[PRELIGHT] = { 0, 0, 0 }
    74   bg[PRELIGHT] = { 0, 1.0, 0 }
    75   bg[ACTIVE] = { 0, 1.0, 0 }
    76   fg[ACTIVE] = { 0, 1.0, 0 }
    77   bg[NORMAL] = { 0, 0, 0 }
    78   fg[NORMAL] = { 0, 1.0, 0 }
    79   bg[INSENSITIVE] = { 1.0, 0, 1.0 }
    80   fg[INSENSITIVE] = { 1.0, 0, 1.0 }
    81   base[NORMAL] = { 0, 1.0, 0 }
    82   base[PRELIGHT] = { 0, 1.0, 0 }
    83 }
     47"style'text'"
     48"{"
     49"fg[NORMAL] = { 0, 1.0, 0 }"
     50"}"
    8451
    85 # In this example, we inherit the attributes of the "button" style and then
    86 # override the font and background color when prelit to create a new
    87 # "main_button" style.
     52"style'ruler'"
     53"{"
     54"font = '-adobe-helvetica-medium-r-normal--*-20-*-*-*-*-*-*'"
     55"}"
    8856
    89 style "main_button" = "button"
    90 {
    91   font = "-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
    92   bg[PRELIGHT] = { 0, 0.75, 0 }
    93 }
     57"widget'GtkWindow'              style'window'"
     58"widget'GtkFrame'               style'window'"
     59"widget'Gtk*EventBox'           style'window'"
     60"widget'GtkDialog'              style'window'"
     61"widget'GtkFileSelection'       style'window'"
     62"widget'*Gtk*Scale'             style'scale'"
     63"widget'*GtkCheckButton*'       style'toggle_button'"
     64"widget'*Gtk*Menu*'             style'toggle_button'"
     65"widget'*GtkRadioButton*'       style'toggle_button'"
     66"widget'*GtkButton*'            style'button'"
     67"widget'*Ruler'                 style'ruler'"
     68"widget'*GtkText'               style'text'"
     69"widget'*GtkLabel'              style'text'"
    9470
    95 style "toggle_button" = "button"
    96 {
    97   fg[NORMAL] = { 0, 1.0, 0 }
    98   fg[ACTIVE] = { 0, 1.0, 0 }
    99   text[NORMAL] = { 0, 0, 0}
    100   # This sets the background pixmap of the toggle_button to that of its
    101   # parent widget (as defined in the application).
    102   #bg_pixmap[NORMAL] = "<parent>"
    103 }
    104 
    105 style "text"
    106 {
    107   #bg_pixmap[NORMAL] = "marble.xpm"
    108   fg[NORMAL] = { 0, 1.0, 0 }
    109 }
    110 
    111 style "ruler"
    112 {
    113   font = "-adobe-helvetica-medium-r-normal--*-20-*-*-*-*-*-*"
    114 }
    115 
    116 # pixmap_path "~/.pixmaps"
    117 
    118 # These set the widget types to use the styles defined above.
    119 # The widget types are listed in the class hierarchy, but could probably be
    120 # just listed in this document for the users reference.
    121 
    122 widget_class "GtkWindow"           style "window"
    123 widget_class "GtkFrame"            style "window"
    124 widget_class "Gtk*EventBox"        style "window"
    125 widget_class "GtkDialog"           style "window"
    126 widget_class "GtkFileSelection"    style "window"
    127 widget_class "*Gtk*Scale"          style "scale"
    128 widget_class "*GtkCheckButton*"    style "toggle_button"
    129 widget_class "*Gtk*Menu*"          style "toggle_button"
    130 widget_class "*GtkRadioButton*"    style "toggle_button"
    131 widget_class "*GtkButton*"         style "button"
    132 widget_class "*Ruler"              style "ruler"
    133 widget_class "*GtkText"            style "text"
    134 widget_class "*GtkLabel"           style "text"
     71"widget'main window.*GtkButton*' style 'main_button'"
    13572
    13673
    137 # This sets all the buttons that are children of the "main window" to
    138 # the main_button style.  These must be documented to be taken advantage of.
    139 widget "main window.*GtkButton*" style "main_button"
     74);
Note: See TracChangeset for help on using the changeset viewer.