Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
kohait00 is currently offline  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# Smile 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

 
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: Fri Apr 19 03:12:33 CEST 2024

Total time taken to generate the page: 0.02740 seconds