Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GetProperty() / SetProperty() for Ctrl
Re: GetProperty() / SetProperty() for Ctrl [message #30101 is a reply to message #30100] |
Thu, 09 December 2010 08:36 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
i'd prefer if's as well, if one could override them externally..
but it is questionable, if it is usefull to derive/override properties. if yes, than callbacks are the only option so far.
so a still stayed with the explicit naming of the handlers, so full control in handlers remains. everything else is done as you said, this is the result so far.
CTRL_PROPERTIES(Ctrl, RecurseDone)
PROPERTY("data", PropSetData, PropGetData)
PROPERTY("enable", PropEnable, PropIsEnabled)
PROPERTY("show", PropShow, PropIsVisible)
PROPERTY("editable", PropEditable, PropIsEditable)
PROPERTY("logpos", PropSetLogPos, PropGetLogPos)
PROPERTY("focus", PropFocus, PropHasFocus)
PROPERTY("modify", PropModify, PropIsModified)
PROPERTY("tip", PropSetTip, PropGetTip)
PROPERTY("wantfocus", PropWantFocus, PropIsWantFocus)
PROPERTY("initFocus", PropInitFocus, PropIsInitFocus)
PROPERTY("backpaint", PropBackPaint, PropIsBackPaint)
PROPERTY("transparent", PropTransparent, PropIsTransparent)
PROPERTY_SET("refresh", PropRefresh)
END_CTRL_PROPERTIES
..
CTRL_PROPERTIES(EditInt, Ctrl)
PROPERTY("min", PropSetMin, PropGetMin)
PROPERTY("max", PropSetMax, PropGetMax)
END_CTRL_PROPERTIES
if c++ had delegates like in c# that'd be the best.
BTW: how to install a MouseHook (which is no __thiscall) to operate on a application local TopWindow? i want to start an edit properties window on arbitrary controls upon a mouse+key combination..
EDIT: solution found, just tell me if there are pitfalls i dont see:
bool MyMouseHook(Ctrl *ctrl, bool inframe, int event, Point p,
int zdelta, dword keyflags)
{
if(event & (Ctrl::MOUSEMOVE | Ctrl::MOUSEENTER | Ctrl::MOUSELEAVE | Ctrl::CURSORIMAGE)) return false;
if((keyflags & K_MOUSERIGHT))
if((keyflags & K_SHIFT_CTRL))
{
CallbackArgTarget<int> m;
MenuBar menu;
menu.Add("List Properties",m[0]);
menu.Add("Edit Properties",m[1]);
menu.Execute();
if(IsNull(m)) return true;
switch(m)
{
case 0:
{ PropList& p = Single<PropList>(); p.PopUp(Ctrl::GetActiveWindow(), *ctrl); }
break;
case 1:
{ PropEdit& p = Single<PropEdit>(); p.PopUp(Ctrl::GetActiveWindow(), *ctrl); }
break;
}
return true;
}
return false;
}
[Updated on: Thu, 09 December 2010 08:52] Report message to a moderator
|
|
|
|
|
GetProperty() / SetProperty() for Ctrl
By: kohait00 on Wed, 17 November 2010 17:46
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 18 November 2010 15:12
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: koldo on Thu, 18 November 2010 18:28
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 18 November 2010 20:03
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 18 November 2010 23:20
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Wed, 24 November 2010 17:51
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Sat, 27 November 2010 18:31
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Sun, 28 November 2010 11:01
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Tue, 30 November 2010 21:12
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Wed, 01 December 2010 09:00
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Wed, 01 December 2010 10:04
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Wed, 01 December 2010 18:00
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Wed, 01 December 2010 20:22
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 08:44
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 09:24
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Thu, 02 December 2010 11:03
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 11:18
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Thu, 02 December 2010 11:22
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 11:24
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Thu, 02 December 2010 13:33
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 13:39
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 02 December 2010 23:50
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Fri, 03 December 2010 09:31
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Thu, 09 December 2010 06:59
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 09 December 2010 07:03
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: mirek on Thu, 09 December 2010 08:15
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Thu, 09 December 2010 08:36
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Fri, 10 December 2010 08:55
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Fri, 10 December 2010 10:32
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: kohait00 on Wed, 26 January 2011 13:55
|
|
|
properties like in C#
By: kohait00 on Tue, 01 February 2011 14:45
|
|
|
Re: properties like in C#
|
|
|
Re: properties like in C#
By: kohait00 on Tue, 01 February 2011 18:51
|
|
|
Re: properties like in C#
By: koldo on Tue, 01 February 2011 22:34
|
|
|
Re: properties like in C#
By: kohait00 on Wed, 02 February 2011 09:30
|
|
|
Re: GetProperty() / SetProperty() for Ctrl
By: luluxiu on Fri, 01 July 2011 04:18
|
Goto Forum:
Current Time: Fri Apr 19 03:12:33 CEST 2024
Total time taken to generate the page: 0.02740 seconds
|