123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- class IUP_DETACH_BOX
-
- inherit
- IUP_CONTAINER
- redefine
- execute_detached,
- execute_restored
- end
- IUP_WIDGET_EXPAND
- IUP_WIDGET_WID
- IUP_WIDGET_FONT
- IUP_WIDGET_SIZE
- IUP_WIDGET_RASTERSIZE
- IUP_WIDGET_USERSIZE
- IUP_WIDGET_CLIENTSIZE
- IUP_WIDGET_CLIENTOFFSET
- IUP_WIDGET_POSITION
- IUP_WIDGET_MAXMIN_SIZE
- IUP_WIDGET_CHILD
- IUP_WIDGET_NAME
- IUP_WIDGET_CUSTOM_ATTRIBUTES
- create {ANY}
- detach_box_empty,
- detach_box
- feature {ANY}
- detach_box_empty
-
- local
- p, a_detach_box: POINTER
- do
- a_detach_box := int_detach_box (p)
- set_widget(a_detach_box)
- end
-
- detach_box (child: IUP_WIDGET)
-
- local
- a_detach_box: POINTER
- do
- a_detach_box := int_detach_box (child.widget)
- set_widget(a_detach_box)
- end
-
- set_bar_size (size: INTEGER)
-
-
- require
- size >= 0
- do
- iup_open.set_attribute(Current, "BARSIZE", size.out)
- end
- get_bar_size: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "BARSIZE")
- Result := str.to_integer
- end
- set_rgb_color (red, green, blue: INTEGER)
-
-
-
- do
- iup_open.set_attribute(Current, "COLOR", rgb_to_string(red, green, blue))
- end
- get_rgb_color: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "COLOR")
- end
- set_vertical_orientation
-
-
-
- do
- iup_open.set_attribute(Current, "ORIENTATION", "VERTICAL")
- end
- set_horizontal_orientation
-
-
- do
- iup_open.set_attribute(Current, "ORIENTATION", "HORIZONTAL")
- end
- is_vertical: BOOLEAN
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "ORIENTATION")
- if str.is_equal("VERTICAL") then
- Result := True
- else
- Result := False
- end
- end
- get_old_parent_widget: IUP_WIDGET
-
-
- do
- Result := iup_open.get_attribute_widget(Current, "OLDPARENT_HANDLE")
- end
- get_old_brother_widget: IUP_WIDGET
-
-
-
- do
- Result := iup_open.get_attribute_widget(Current, "OLDBROTHER_HANDLE")
- end
- detach_widget
-
-
-
-
-
-
-
-
-
- do
- iup_open.set_attribute_null(Current, "DETACH")
- end
- restore_widget (name: STRING)
-
-
-
-
-
-
- do
- if name.is_equal("NULL") then
- iup_open.set_attribute_null(Current, "RESTORE")
- else
- iup_open.set_attribute(Current, "RESTORE", name)
- end
- end
- set_restore_when_closed (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "RESTOREWHENCLOSED", boolean_to_yesno(state))
- end
- set_show_grip (state: BOOLEAN)
-
-
-
- do
- iup_open.set_attribute(Current, "SHOWGRIP", boolean_to_yesno(state))
- end
- is_show_grip: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "SHOWGRIP")
- Result := yesno_to_boolean(str)
- end
-
- set_cb_detached (act: detachable FUNCTION[TUPLE[IUP_DETACH_BOX, IUP_DIALOG, INTEGER, INTEGER], STRING])
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_detached := act
- if cb_detached /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "DETACHED_CB", "NONEEDED", operation)
- end
- set_cb_restored (act: detachable FUNCTION[TUPLE[IUP_DETACH_BOX, IUP_WIDGET, INTEGER, INTEGER], STRING])
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_restored := act
- if cb_restored /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "RESTORED_CB", "NONEEDED", operation)
- end
- feature {IUP}
-
-
-
- execute_detached (new_parent: IUP_DIALOG; x, y: INTEGER): STRING
- do
- if attached cb_detached as int_cb then
- Result := int_cb.item([Current, new_parent, x, y])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_restored (old_parent: IUP_WIDGET; x, y: INTEGER): STRING
- do
- if attached cb_restored as int_cb then
- Result := int_cb.item([Current, old_parent, x, y])
- else
- Result := "IUP_DEFAULT"
- end
- end
-
- feature {NONE}
-
-
- cb_detached: detachable FUNCTION[TUPLE[IUP_DETACH_BOX, IUP_DIALOG, INTEGER, INTEGER], STRING]
- cb_restored: detachable FUNCTION[TUPLE[IUP_DETACH_BOX, IUP_WIDGET, INTEGER, INTEGER], STRING]
-
-
- int_detach_box (child: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupDetachBox ($child);"
- end
-
- is_valid_orientation (value: STRING): BOOLEAN
- do
- if value.is_equal("HORIZONTAL") or
- value.is_equal("VERTICAL") then
- Result := True
- else
- Result := False
- end
- end
- end
|