123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- class IUP_FRAME
- inherit
- IUP_CONTAINER
- redefine
- execute_map,
- execute_unmap,
- execute_destroy,
- execute_focus
- end
- IUP_WIDGET_BGCOLOR
- IUP_WIDGET_FGCOLOR
- IUP_WIDGET_EXPAND
- IUP_WIDGET_TITLE
- IUP_WIDGET_ACTIVE
- IUP_WIDGET_FONT
- IUP_WIDGET_SCREENPOSITION
- IUP_WIDGET_POSITION
- IUP_WIDGET_CLIENTSIZE
- IUP_WIDGET_CLIENTOFFSET
- IUP_WIDGET_MAXMIN_SIZE
- IUP_WIDGET_SIZE
- IUP_WIDGET_RASTERSIZE
- IUP_WIDGET_USERSIZE
- IUP_WIDGET_ZORDER
- IUP_WIDGET_VISIBLE
- IUP_WIDGET_CHILD
- IUP_WIDGET_NAME
- IUP_WIDGET_CUSTOM_ATTRIBUTES
- create {ANY}
- frame_empty,
- frame
- feature {ANY}
- frame_empty
-
- local
- p, a_frame: POINTER
- do
- a_frame := int_frame (p)
- set_widget(a_frame)
- end
-
- frame (child: IUP_WIDGET)
-
- local
- a_frame: POINTER
- do
- a_frame := int_frame (child.widget)
- set_widget(a_frame)
- end
-
-
- set_childoffset (horizontal, vertical: INTEGER)
- require
- horizontal >= 0
- vertical >= 0
- local
- offset: STRING
- do
- offset := horizontal.out
- offset.append_string("x")
- offset.append_string(vertical.out)
- iup_open.set_attribute(Current, "CHILDOFFSET", offset)
- end
- get_childoffset: TUPLE[INTEGER, INTEGER]
-
- local
- offset: STRING
- do
- offset := iup_open.get_attribute(Current, "CHILDOFFSET")
- Result := components_of_size(offset)
- end
- set_sunken (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "SUNKEN", boolean_to_yesno(state))
- end
-
- set_cb_map (act: detachable FUNCTION[TUPLE[IUP_FRAME], STRING])
-
- local
- operation: INTEGER
- do
- cb_map := act
-
- if cb_map /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "MAP_CB", "NONEEDED", operation)
- end
- set_cb_unmap (act: detachable FUNCTION[TUPLE[IUP_FRAME], STRING])
-
- local
- operation: INTEGER
- do
- cb_unmap := act
- if cb_unmap /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "UNMAP_CB", "NONEEDED", operation)
- end
- set_cb_destroy (act: detachable FUNCTION[TUPLE[IUP_FRAME], STRING])
-
- local
- operation: INTEGER
- do
- cb_destroy := act
- if cb_destroy /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "DESTROY_CB", "NONEEDED", operation)
- end
- set_cb_focus (act: detachable FUNCTION[TUPLE[IUP_FRAME, INTEGER], STRING])
-
-
- local
- operation: INTEGER
- do
- cb_focus := act
- if cb_focus /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FOCUS_CB", "NONEEDED", operation)
- end
- feature {ANY}
- execute_map: STRING
- do
- if attached cb_map as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_unmap: STRING
- do
- if attached cb_unmap as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_destroy: STRING
- do
- if attached cb_destroy as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_focus (focus: INTEGER): STRING
- do
- if attached cb_focus as int_cb then
- Result := int_cb.item([Current, focus])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_map: detachable FUNCTION[TUPLE[IUP_FRAME], STRING]
- cb_unmap: detachable FUNCTION[TUPLE[IUP_FRAME], STRING]
- cb_destroy: detachable FUNCTION[TUPLE[IUP_FRAME], STRING]
- cb_focus: detachable FUNCTION[TUPLE[IUP_FRAME, INTEGER], STRING]
-
-
- int_frame (child: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupFrame ($child);"
- end
-
- end
|