9 class tiseparator ~(dir : Gtk.Tags.orientation) ~(widget : GObj.widget_full)
10 ~name ~parent_tree ~pos ?(insert_evbox=true) parent_window =
12 val separator = widget
13 inherit tiwidget ~name ~widget ~parent_tree ~pos parent_window ~insert_evbox
15 method private class_name =
16 match dir with `VERTICAL -> "GMisc.separator `VERTICAL"
17 | `HORIZONTAL -> "GMisc.separator `HORIZONTAL"
20 (match dir with `VERTICAL -> "vseparator" | `HORIZONTAL -> "hseparator")
24 let new_tihseparator ~name ?(listprop = []) =
25 new tiseparator ~dir: `HORIZONTAL ~name
26 ~widget:(GMisc.separator `HORIZONTAL ())
27 let new_tivseparator ~name ?(listprop = []) =
28 new tiseparator ~dir: `VERTICAL ~name
29 ~widget:(GMisc.separator `VERTICAL ())
34 class tistatusbar ~(widget : GMisc.statusbar) ~name ~parent_tree ~pos
35 ?(insert_evbox=true) parent_window =
37 val statusbar = widget
38 inherit ticontainer ~name ~widget ~insert_evbox
39 ~parent_tree ~pos parent_window as widget
41 method private class_name = "GMisc.statusbar"
47 let new_tistatusbar ~name ?(listprop = []) =
48 new tistatusbar ~widget:(GMisc.statusbar ()) ~name
52 class timisc ~(widget : GMisc.misc) ~name ~parent_tree ~pos
53 ?(insert_evbox=true) parent_window =
56 inherit tiwidget ~name ~widget ~insert_evbox
57 ~parent_tree ~pos parent_window as widget
59 method private class_name = failwith "timisc::class_name"
62 proplist <- proplist @
64 new prop_float ~name:"x alignment" ~init:"0.5" ~min:0. ~max:1.
65 ~set:(fun v -> misc#set_alignment ~x:v (); true);
67 new prop_float ~name:"y alignment" ~init:"0.5" ~min:0. ~max:1.
68 ~set:(fun v -> misc#set_alignment ~y:v (); true);
70 new prop_int ~name:"x padding" ~init:"0.5"
71 ~set:(fun v -> misc#set_padding ~x:v (); true);
73 new prop_int ~name:"y padding" ~init:"0.5"
74 ~set:(fun v -> misc#set_padding ~y:v (); true)
80 class tiarrow ~(widget : GMisc.arrow) ~name ~parent_tree ~pos
81 ?(insert_evbox=true) parent_window =
84 inherit timisc ~name ~widget:(widget :> GMisc.misc) ~insert_evbox
85 ~parent_tree ~pos parent_window as widget
87 method private class_name = "GMisc.arrow"
93 (* TODO fenetre demandant kind et shadow
94 let new_tiarrow ~name = new tiarrow ~widget:(GMisc.arrow ()) ~name
98 class tilabel ~(widget : GMisc.label) ~name ~parent_tree ~pos
99 ?(insert_evbox=true) parent_window =
102 inherit timisc ~name ~widget:(widget :> GMisc.misc) ~insert_evbox
103 ~parent_tree ~pos parent_window as widget
105 method private class_name = "GMisc.label"
107 method private get_mandatory_props = [ "text" ]
111 proplist <- proplist @
113 new prop_string ~name:"text" ~init:name ~set:(ftrue labelw#set_text);
115 new prop_bool ~name:"line_wrap" ~init:"true"
116 ~set:(ftrue labelw#set_line_wrap)
120 let new_tilabel ~name ?(listprop = []) =
121 new tilabel ~widget:(GMisc.label ~text:name ()) ~name
127 class ticolor_selection ~(widget : GMisc.color_selection) ~name ~parent_tree ~pos
128 ?(insert_evbox=true) parent_window =
130 val color_selection = widget
131 inherit tiwidget ~name ~widget ~insert_evbox
132 ~parent_tree ~pos parent_window as widget
134 method private class_name = "GMisc.color_selection"
137 classe <- "color_selection";
138 proplist <- proplist @
140 new prop_bool ~name:"use_opacity" ~init:"false"
141 ~set:(ftrue color_selection#set_opacity);
143 new prop_update_type ~name:"update_policy" ~init:"CONTINUOUS"
144 ~set:(ftrue color_selection#set_update_policy)
148 let new_ticolor_selection ~name ?(listprop = []) =
149 new ticolor_selection ~widget:(GMisc.color_selection ()) ~name
152 class tipixmap ~(widget : GMisc.pixmap) ~name ~parent_tree ~pos
153 ?(insert_evbox=true) parent_window =
156 inherit timisc ~name ~widget:(widget :> GMisc.misc) ~insert_evbox
157 ~parent_tree ~pos parent_window as widget
159 method private class_name = "GMisc.pixmap"
162 proplist <- proplist @
164 new prop_file ~name:"file" ~init:""
167 (GDraw.pixmap_from_xpm ~window:parent_window#tiwin#widget
173 let new_tipixmap ~name ?(listprop = []) ~parent_tree ~pos ?(insert_evbox=true) (parent_window : window_and_tree0) =
174 new tipixmap ~widget:(GMisc.pixmap (GDraw.pixmap_from_xpm
175 ~window:parent_window#tiwin#widget ~file:"pixmap.xpm" ()) ()) ~name
176 ~parent_tree ~pos ~insert_evbox parent_window