123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- class IUP_EXPANDER
- inherit
- IUP_CONTAINER
- redefine
- execute_action,
- execute_openclose,
- execute_extrabutton
- end
- IUP_WIDGET_EXPAND
- IUP_WIDGET_TITLE
- 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}
- expander_empty,
- expander
- feature {ANY}
- expander_empty
-
- local
- p, a_expander: POINTER
- do
- a_expander := int_expander (p)
- set_widget(a_expander)
- end
-
- expander (child: IUP_WIDGET)
-
- local
- a_expander: POINTER
- do
- a_expander := int_expander (child.widget)
- set_widget(a_expander)
- end
-
- set_autoshow (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "AUTOSHOW", boolean_to_yesno(state))
- end
- is_autoshow: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "AUTOSHOW")
- Result := yesno_to_boolean(str)
- end
- set_animation (value: STRING)
-
-
-
-
-
-
- require
- is_valid_animation(value)
- do
- iup_open.set_attribute(Current, "ANIMATION", value)
- end
- get_animation: STRING
-
- do
- Result := iup_open.get_attribute(Current, "ANIMATION")
- end
- set_number_of_frames (num: INTEGER)
-
-
- require
- non_negative: num >= 0
- do
- iup_open.set_attribute(Current, "NUMFRAMES", num.out)
- end
- get_number_of_frames: INTEGER
-
- local
- num: STRING
- do
- num := iup_open.get_attribute(Current, "NUMFRAMES")
- Result := num.to_integer
- end
- set_frame_time (time: INTEGER)
-
-
-
-
- require
- non_negative: time >= 0
- do
- iup_open.set_attribute(Current, "FRAMETIME", time.out)
- end
- get_frame_time: INTEGER
-
- local
- time: STRING
- do
- time := iup_open.get_attribute(Current, "FRAMETIME")
- Result := time.to_integer
- end
- set_rgb_back_color (red, green, blue: INTEGER)
-
-
- do
- iup_open.set_attribute(Current, "BACKCOLOR", rgb_to_string(red, green, blue))
- end
- get_rgb_back_color: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "BACKCOLOR")
- end
- set_bar_position (value: STRING)
-
-
- require
- is_valid_barposition(value)
- do
- iup_open.set_attribute(Current, "BARPOSITION", value)
- end
- get_bar_position: STRING
-
- do
- Result := iup_open.get_attribute(Current, "BARPOSITION")
- end
- set_bar_size (size: INTEGER)
-
-
-
- require
- non_negative: size >= 0
- do
- iup_open.set_attribute(Current, "BARSIZE", size.out)
- end
- get_bar_size: INTEGER
-
- local
- size: STRING
- do
- size := iup_open.get_attribute(Current, "BARSIZE")
- Result := size.to_integer
- end
- set_extra_buttons (n: INTEGER)
-
-
-
- require
- n >= 0
- n <= 3
- do
- iup_open.set_attribute(Current, "EXTRABUTTONS", n.out)
- end
- get_extra_buttons: INTEGER
-
- local
- n: STRING
- do
- n := iup_open.get_attribute(Current, "EXTRABUTTONS")
- Result := n.to_integer
- end
- set_extra_button_id_image (imagename: STRING; id: INTEGER)
-
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRA" + id.out
- iup_open.set_attribute(Current, str, imagename)
- end
- get_extra_button_id_image (id: INTEGER): STRING
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRA" + id.out
- Result := iup_open.get_attribute(Current, str)
- end
- set_extra_button_id_image_press (imagename: STRING; id: INTEGER)
-
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRAPRESS" + id.out
- iup_open.set_attribute(Current, str, imagename)
- end
- get_extra_button_id_image_press (id: INTEGER): STRING
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRAPRESS" + id.out
- Result := iup_open.get_attribute(Current, str)
- end
- set_extra_button_id_image_highlight (imagename: STRING; id: INTEGER)
-
-
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRAHIGHLIGHT" + id.out
- iup_open.set_attribute(Current, str, imagename)
- end
- get_extra_button_id_image_highlight (id: INTEGER): STRING
-
-
- require
- id >= 0
- id <= 3
- local
- str: STRING
- do
- str := "IMAGEEXTRAHIGHLIGHT" + id.out
- Result := iup_open.get_attribute(Current, str)
- end
- set_rgb_fore_color (red, green, blue: INTEGER)
-
-
- do
- iup_open.set_attribute(Current, "FORECOLOR", rgb_to_string(red, green, blue))
- end
-
- get_rgb_fore_color: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "FORECOLOR")
- end
- set_rgb_open_color (red, green, blue: INTEGER)
-
-
- do
- iup_open.set_attribute(Current, "OPENCOLOR", rgb_to_string(red, green, blue))
- end
-
- get_rgb_open_color: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "OPENCOLOR")
- end
- set_rgb_high_color (red, green, blue: INTEGER)
-
-
- do
- iup_open.set_attribute(Current, "HIGHCOLOR", rgb_to_string(red, green, blue))
- end
-
- get_rgb_high_color: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "HIGHCOLOR")
- end
- set_image (imagename: STRING)
-
-
-
-
- do
- iup_open.set_attribute(Current, "IMAGE", imagename)
- end
- get_image: STRING
-
- do
- Result := iup_open.get_attribute(Current, "IMAGE")
- end
- set_image_open (imagename: STRING)
-
- do
- iup_open.set_attribute(Current, "IMAGEOPEN", imagename)
- end
- get_image_open: STRING
-
- do
- Result := iup_open.get_attribute(Current, "IMAGEOPEN")
- end
- set_image_highlight (imagename: STRING)
-
- do
- iup_open.set_attribute(Current, "IMAGEHIGHLIGHT", imagename)
- end
- get_image_highlight: STRING
-
-
- do
- Result := iup_open.get_attribute(Current, "IMAGEHIGHLIGHT")
- end
- set_image_open_highlight (imagename: STRING)
-
-
- do
- iup_open.set_attribute(Current, "IMAGEOPENHIGHLIGHT", imagename)
- end
- get_image_open_highlight: STRING
-
-
- do
- Result := iup_open.get_attribute(Current, "IMAGEOPENHIGHLIGHT")
- end
- set_expanded
-
-
-
- do
- iup_open.set_attribute(Current, "STATE", "OPEN")
- end
- set_collapsed
-
-
-
- do
- iup_open.set_attribute(Current, "STATE", "CLOSE")
- end
- is_expanded: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "STATE")
- if str.is_equal("OPEN") then
- Result := True
- else
- Result := False
- end
- end
- set_state_refresh (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "STATEREFRESH", boolean_to_yesno(state))
- end
- is_state_refresh: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "STATEREFRESH")
- Result := yesno_to_boolean(str)
- end
- set_title_image (imagename: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "TITLEIMAGE", imagename)
- end
-
- get_title_image: STRING
-
- do
- Result := iup_open.get_attribute(Current, "TITLEIMAGE")
- end
-
- set_title_image_open (imagename: STRING)
-
- do
- iup_open.set_attribute(Current, "TITLEIMAGEOPEN", imagename)
- end
- get_title_image_open: STRING
-
- do
- Result := iup_open.get_attribute(Current, "TITLEIMAGEOPEN")
- end
- set_title_image_highlight (imagename: STRING)
-
- do
- iup_open.set_attribute(Current, "TITLEIMAGEHIGHLIGHT", imagename)
- end
- get_title_image_highlight: STRING
-
-
- do
- Result := iup_open.get_attribute(Current, "TITLEIMAGEHIGHLIGHT")
- end
- set_title_image_open_highlight (imagename: STRING)
-
-
- do
- iup_open.set_attribute(Current, "TITLEIMAGEOPENHIGHLIGHT", imagename)
- end
- get_title_image_open_highlight: STRING
-
-
- do
- Result := iup_open.get_attribute(Current, "TITLEIMAGEOPENHIGHLIGHT")
- end
- set_title_expand (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "TITLEEXPAND", boolean_to_yesno(state))
- end
- is_title_expand: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "TITLEEXPAND")
- Result := yesno_to_boolean(str)
- end
-
-
- set_cb_action (act: detachable FUNCTION[TUPLE[IUP_EXPANDER], STRING])
-
-
- local
- operation: INTEGER
- do
- cb_action := act
- if cb_action /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "ACTION", "Fn", operation)
- end
-
- set_cb_open_close (act: detachable FUNCTION[TUPLE[IUP_EXPANDER, INTEGER], STRING])
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_openclose := act
- if cb_openclose /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "OPENCLOSE_CB", "NONEEDED", operation)
- end
- set_cb_extra_button (act: detachable FUNCTION[TUPLE[IUP_EXPANDER, INTEGER, INTEGER], STRING])
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_extrabutton := act
- if cb_extrabutton /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "EXTRABUTTON_CB", "NONEEDED", operation)
- end
-
- is_valid_animation (value: STRING): BOOLEAN
- do
- if value.is_equal("SLIDE") or
- value.is_equal("CURTAIN") or
- value.is_equal("NO") then
- Result := True
- else
- Result := False
- end
- end
- is_valid_barposition (value: STRING): BOOLEAN
- do
- if value.is_equal("TOP") or
- value.is_equal("BOTTOM") or
- value.is_equal("LEFT") or
- value.is_equal("RIGHT") then
- Result := True
- else
- Result := False
- end
- end
- feature {IUP}
-
- execute_action: STRING
- do
- if attached cb_action as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_openclose (state: INTEGER): STRING
- do
- if attached cb_openclose as int_cb then
- Result := int_cb.item([Current, state])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_extrabutton (button, pressed: INTEGER): STRING
- do
- if attached cb_extrabutton as int_cb then
- Result := int_cb.item([Current, button, pressed])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_action: detachable FUNCTION[TUPLE[IUP_EXPANDER], STRING]
-
- cb_openclose: detachable FUNCTION[TUPLE[IUP_EXPANDER, INTEGER], STRING]
- cb_extrabutton: detachable FUNCTION[TUPLE[IUP_EXPANDER, INTEGER, INTEGER], STRING]
-
- int_expander (child: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupExpander ($child);"
- end
- end
|