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 » Look and Chameleon Technology » FIX: proper use of Style in Ctrls from CtrlLib
FIX: proper use of Style in Ctrls from CtrlLib [message #27072] Thu, 24 June 2010 12:38 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi folks,

i stumbled over inconsistant use of style stuff inside some upp Ctrls, names EditCtrl, Calender, Clock, ButtonOption..

they should not have stuff like

Paint:
const Style &st = style ? *style : StyleDefault();


but should instead properly do what other Ctrl's do

ctor:
style = &StyleDefault();

//Paint and elsewhere
style->line...



this prevents things from breaking up when editing global style information (over StyleDefault)..

i attached a rar file with .svn inside to easy compare what i mean.

PS: neither should Font be part of Style or should it.. i havent found any other that Calender Ctrl to be the case... because SetFont should be used instead, right?

RFC
  • Attachment: CtrlLib.rar
    (Size: 975.03KB, Downloaded 331 times)
Re: FIX: proper use of Style in Ctrls from CtrlLib [message #27103 is a reply to message #27072] Fri, 25 June 2010 15:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes.

Mirek
Re: FIX: proper use of Style in Ctrls from CtrlLib [message #27106 is a reply to message #27103] Fri, 25 June 2010 15:34 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hey mirek,

something went wrong i thing, in the last cmmit 2508
i even missed it myself...
EditField::EditField()
{
	dropcaret = Rect(0, 0, 0, 0);
	style = &StyleDefault(); // <---
	Unicode();
	Reset();
	WhenBar = THISBACK(StdBar);
}


and:
void EditField::Paint(Draw& w)
{
	Size sz = GetSize();
	const EditField::Style& st = StyleDefault(); //<--- this one prevents overriding style completely, should be '*style;'
	bool enabled = IsShowEnabled();



and:
what about ButtonOption Smile
Re: FIX: proper use of Style in Ctrls from CtrlLib [message #27116 is a reply to message #27106] Sat, 26 June 2010 08:38 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Fri, 25 June 2010 09:34

hey mirek,

something went wrong i thing, in the last cmmit 2508
i even missed it myself...
EditField::EditField()
{
	dropcaret = Rect(0, 0, 0, 0);
	style = &StyleDefault(); // <---
	Unicode();
	Reset();
	WhenBar = THISBACK(StdBar);
}





This one is in Reset... In fact, EditField was working properly, the only problem was redundant code in Paint.

void EditField::Paint(Draw& w)
{
	Size sz = GetSize();
	const EditField::Style& st = StyleDefault(); //<--- this one prevents overriding style completely, should be '*style;'
	bool enabled = IsShowEnabled();



Ops Smile

Mirek

[Updated on: Sat, 26 June 2010 08:39]

Report message to a moderator

Previous Topic: Manual for custom Chameleonized Ctrls
Next Topic: Easiest way to change button color
Goto Forum:
  


Current Time: Fri Mar 29 14:46:13 CET 2024

Total time taken to generate the page: 0.01585 seconds