123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496 |
- class IUP_FLAT_TOGGLE
-
- inherit
- IUP_CANVAS
- redefine
- set_border,
- set_can_focus,
- set_expand,
- execute_flat_action,
- execute_flat_button,
- execute_flat_focus,
- execute_flat_enterwindow,
- execute_flat_leavewindow,
- execute_valuechanged
- end
- IUP_WIDGET_FGCOLOR
- IUP_WIDGET_SPACING
- IUP_WIDGET_TITLE
- IUP_WIDGET_FLAT_TEXT
- redefine
- set_alignment
- end
- IUP_WIDGET_BACK_IMAGE_2
- IUP_WIDGET_FRONT_IMAGE_2
- IUP_WIDGET_IMAGE_2
- IUP_WIDGET_PADDING
- IUP_WIDGET_BORDER
- IUP_WIDGET_HAS_FOCUS
- IUP_WIDGET_HIGHLIGHT
- IUP_WIDGET_PRESS
- IUP_WIDGET_IGNORERADIO
- IUP_WIDGET_FOCUSFEEDBACK
- IUP_WIDGET_TOGGLE
- create {ANY}
- flat_toggle_empty,
- flat_toggle
- feature {ANY}
- flat_toggle_empty
- local
- a_flat_toggle, p: POINTER
- do
- a_flat_toggle := int_flat_toggle(p)
-
- set_widget(a_flat_toggle)
- end
- flat_toggle (text: STRING)
- local
- a_flat_toggle: POINTER
- do
- a_flat_toggle := int_flat_toggle(get_pointer(text.to_c))
-
- set_widget(a_flat_toggle)
- end
-
- set_alignment (horizontal, vertical: STRING)
-
-
-
-
- do
- Precursor (horizontal, vertical)
- end
- set_border (state: BOOLEAN)
-
- do
- Precursor (state)
- end
- set_can_focus (state: BOOLEAN)
-
-
-
- do
- Precursor (state)
- end
- set_check_size (value: INTEGER)
-
-
-
-
- require
- value > -1
- do
- iup_open.set_attribute(Current, "CHECKSIZE", value.out)
- end
- set_check_at_right (state: BOOLEAN)
-
- do
- iup_open.set_attribute(Current, "CHECKRIGHT", boolean_to_yesno(state))
- end
- set_check_spacing (value: INTEGER)
-
-
- require
- value > -1
- do
- iup_open.set_attribute(Current, "CHECKSPACING", value.out)
- end
- set_check_alignment (value: STRING)
-
-
- require
- is_valid_vertical_alignment(value)
- do
- iup_open.set_attribute(Current, "CHECKALIGN", value)
- end
- set_chek_image (name: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGE", name)
- end
- set_check_image_highlight (name: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGEHIGHLIGHT", name)
- end
- set_check_image_inactive (name: STRING)
-
-
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGEINACTIVE", name)
- end
- set_check_image_press (name: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGEPRESS", name)
- end
- set_check_image_on (name: STRING)
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGEON*", name)
- end
- set_check_image_not_def (name: STRING)
-
-
- do
- iup_open.set_attribute(Current, "CHECKIMAGENOTDEF*", name)
- end
- set_expand (type: STRING)
-
- do
- Precursor (type)
- end
- is_radio: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "RADIO")
- Result := yesno_to_boolean(str)
- end
- set_selected_notify (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "SELECTEDNOTIFY", boolean_to_yesno(state))
- end
- set_value (value: STRING)
-
-
-
-
- require
- is_valid_state(value)
- do
- iup_open.set_attribute(Current, "VALUE", value)
- end
- get_value: STRING
- do
- Result := iup_open.get_attribute(Current, "VALUE")
- end
- set_3state (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "3STATE", boolean_to_yesno(state))
- end
-
- invert
-
- do
- iup_open.set_attribute(Current, "VALUE", "TOGGLE")
- end
-
- set_cb_flat_action (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING])
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_flat_action := act
- if cb_flat_action /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FLAT_ACTION", "Fnff", operation)
- end
- set_cb_value_changed (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING])
-
- local
- operation: INTEGER
- do
- cb_valuechanged := act
- if cb_valuechanged /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "VALUECHANGED_CB", "NONEEDED", operation)
- end
-
- set_cb_flat_button (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING])
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_flat_button := act
- if cb_flat_button /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FLAT_BUTTON_CB", "NONEEDED", operation)
- end
- set_cb_flat_focus (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE, INTEGER], STRING])
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_flat_focus := act
- if cb_focus /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FLAT_FOCUS_CB", "NONEEDED", operation)
- end
- set_cb_flat_enter_window (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING])
-
- local
- operation: INTEGER
- do
- cb_flat_enterwindow := act
- if cb_enterwindow /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FLAT_ENTERWINDOW_CB", "NONEEDED", operation)
- end
- set_cb_flat_leave_window (act: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING])
-
- local
- operation: INTEGER
- do
- cb_flat_leavewindow := act
- if cb_leavewindow /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FLAT_LEAVEWINDOW_CB", "NONEEDED", operation)
- end
-
- is_valid_state (value: STRING): BOOLEAN
- do
- if value.is_equal("ON") or
- value.is_equal("OFF") or
- value.is_equal("NOTDEF") then
- Result := True
- else
- Result := False
- end
- end
- feature {IUP}
-
- execute_flat_action: STRING
- do
- if attached cb_flat_action as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_valuechanged: STRING
- do
- if attached cb_valuechanged as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_flat_button (btn, pressed, x, y: INTEGER; status: STRING): STRING
- do
- if attached cb_flat_button as int_cb then
- Result := int_cb.item([Current, btn, pressed, x, y, status])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_flat_focus (focus: INTEGER): STRING
- do
- if attached cb_flat_focus as int_cb then
- Result := int_cb.item([Current, focus])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_flat_enterwindow: STRING
- do
- if attached cb_flat_enterwindow as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_flat_leavewindow: STRING
- do
- if attached cb_flat_leavewindow as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
- cb_flat_action: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING]
- cb_valuechanged: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING]
- cb_flat_button: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING]
- cb_flat_focus: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE, INTEGER], STRING]
- cb_flat_enterwindow: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING]
- cb_flat_leavewindow: detachable FUNCTION[TUPLE[IUP_FLAT_TOGGLE], STRING]
-
-
- int_flat_toggle (t: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupFlatToggle ($t);"
- end
-
- end
|