U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GetProperty() / SetProperty() for Ctrl
Re: GetProperty() / SetProperty() for Ctrl [message #30011 is a reply to message #29995] Thu, 02 December 2010 23:50 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
i finally came up with sth like this, what do you think about it?


//for Ctrl

CTRL_PROPERTIES(Ctrl)
PROPERTY(Ctrl, "data", PropSetData, PropGetData)
PROPERTY(Ctrl, "enable", PropEnable, PropIsEnabled)
PROPERTY(Ctrl, "show", PropShow, PropIsVisible)
PROPERTY(Ctrl, "editable", PropEditable, PropIsEditable)
PROPERTY(Ctrl, "logpos", PropSetLogPos, PropGetLogPos)
PROPERTY(Ctrl, "focus", PropFocus, PropHasFocus)
PROPERTY(Ctrl, "modify", PropModify, PropIsModified)
PROPERTY(Ctrl, "tip", PropSetTip, PropGetTip)
PROPERTY(Ctrl, "wantfocus", PropWantFocus, PropIsWantFocus)
PROPERTY(Ctrl, "initFocus", PropInitFocus, PropIsInitFocus)
PROPERTY(Ctrl, "backpaint", PropBackPaint, PropIsBackPaint)
PROPERTY(Ctrl, "transparent", PropTransparent, PropIsTransparent)
PROPERTY_SET(Ctrl, "refresh", PropRefresh)
END_CTRL_PROPERTIES(Ctrl, RecurseDone)

//for EditInt

DEC_CTRL_PROPERTIES(Ctrl)

CTRL_PROPERTIES(EditInt)
PROPERTY(EditInt, "min", PropSetMin, PropGetMin)
PROPERTY(EditInt, "max", PropSetMax, PropGetMax)
END_CTRL_PROPERTIES(EditInt, Ctrl)



this already works and is a more slim solution as before. take a look in header.

note how one can specify properties even separated (see Ctrl definition)..

a good option is, that properties could be reset to sth different (overridden), by specifying again:
PROPERTY(Ctrl, "data", MyPropSetData, MyPropGetData)


i think this is simple enough..what do you think?

[Updated on: Fri, 03 December 2010 09:05]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Drag and Drop between instances [FEATURE REQUEST]
Next Topic: PrinterJob prints blank pages in linux
Goto Forum:
  


Current Time: Tue Jul 14 11:21:06 GMT+2 2026

Total time taken to generate the page: 0.01044 seconds