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 » ArrayCtrl, HeaderCtrl & GridCtrl » FIX: ArrayCtrl to support Style
FIX: ArrayCtrl to support Style [message #30196] Tue, 14 December 2010 17:50 Go to next message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
here is changes for ArrayCtrl supporting Style stuff.
this obsoletes 2 functions, EvenRowColor(), OddRowColor()

maybe this can go upstream.
  • Attachment: ArrayCtrl.h
    (Size: 25.83KB, Downloaded 461 times)
  • Attachment: ArrayCtrl.cpp
    (Size: 61.41KB, Downloaded 202 times)
Re: FIX: ArrayCtrl to support Style [message #30234 is a reply to message #30196] Fri, 17 December 2010 11:58 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
a problem arises, TheIDE would need some fixes, since it is using the EvenRowColor etc.. things that are in Style now, so there one would need to use own Style per control..

EDIT:
some packages use the EvenRowColor/OddRowColor thing..

Quote:


C:\uppsvn\uppsrc\CtrlLib\AKeys.cpp(112): keys.NoHorzGrid().NoCursor();//.EvenRowColor();
C:\uppsvn\uppsrc\ide\Goto.cpp(157): //list.EvenRowColor();
C:\uppsvn\uppsrc\ide\OutputMode.cpp(113): //package.EvenRowColor();
C:\uppsvn\uppsrc\ide\SelectPkg.cpp(316): //alist.EvenRowColor();
C:\uppsvn\uppsrc\ide\Setup.cpp(409): hlt.hlstyle.NoHorzGrid().SetLineCy(EditField::GetStdHeight() + 2);//.EvenRowColor()
C:\uppsvn\uppsrc\ide\Thisbacks.cpp(50): //list.EvenRowColor();
C:\uppsvn\uppsrc\ide\Virtuals.cpp(104): //list.EvenRowColor();
C:\uppsvn\uppsrc\RichEdit\StyleKeys.cpp(32): list.NoHorzGrid().NoCursor();//.EvenRowColor()
C:\uppsvn\uppsrc\usvn\SvnSync.cpp(26): list.NoCursor();//.EvenRowColor();



bazaar/Controls_4U

[Updated on: Sun, 26 December 2010 13:51]

Report message to a moderator

Re: FIX: ArrayCtrl to support Style [message #32036 is a reply to message #30234] Mon, 18 April 2011 17:39 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
is there plans to make ArrayCtrl styleable?
i can provide fixes for the ide and stuff..
mainly because the .EvenRowColor() method would become obsolete.
thus the ide needs to have a local ArrayCtrl::Style instance around in some places..
Re: FIX: ArrayCtrl to support Style [message #32043 is a reply to message #32036] Tue, 19 April 2011 07:40 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12015
Registered: November 2005
Ultimate Member
kohait00 wrote on Mon, 18 April 2011 11:39

is there plans to make ArrayCtrl styleable?



Definitely not at the price of removing important methods Wink
Re: FIX: ArrayCtrl to support Style [message #32047 is a reply to message #32043] Tue, 19 April 2011 09:21 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
dont want to argue with you about this issue. i only propose.
EvenRowColor and OddRowColor could still remain as statics in terms of definition of the colors, but their place to store it would change (into Style instance).

i mean sth like this:
ArrayCtrl.h
	static inline void EvenRowColor(Color& paper, Color& ink) { paper = Blend(SColorMark, SColorPaper, 220); ink = SColorText; }
	static inline void OddRowColor(Color& paper, Color& ink)  { paper = SColorInfo; ink = SColorText; }

somewhere where EvenRowColor needed
ArrayCtrl::Style st; //.h

//.cpp, ctor
	st = ArrayCtrl::StyleDefault();
	ArrayCtrl::EvenRowColor(st.evenpaper, st.evenink);
	list.SetStyle(st);

which is more code ofcorse but renders ArrayCtrl as stylable where needed.

Re: FIX: ArrayCtrl to support Style [message #32061 is a reply to message #32047] Tue, 19 April 2011 19:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12015
Registered: November 2005
Ultimate Member
kohait00 wrote on Tue, 19 April 2011 03:21

dont want to argue with you about this issue. i only propose.
EvenRowColor and OddRowColor could still remain as statics in terms of definition of the colors, but their place to store it would change (into Style instance).

i mean sth like this:
ArrayCtrl.h
	static inline void EvenRowColor(Color& paper, Color& ink) { paper = Blend(SColorMark, SColorPaper, 220); ink = SColorText; }
	static inline void OddRowColor(Color& paper, Color& ink)  { paper = SColorInfo; ink = SColorText; }

somewhere where EvenRowColor needed
ArrayCtrl::Style st; //.h

//.cpp, ctor
	st = ArrayCtrl::StyleDefault();
	ArrayCtrl::EvenRowColor(st.evenpaper, st.evenink);
	list.SetStyle(st);

which is more code ofcorse but renders ArrayCtrl as stylable where needed.




You misunderstand the true meaning of those methods.
Re: FIX: ArrayCtrl to support Style [message #32065 is a reply to message #32061] Tue, 19 April 2011 20:27 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
always prepared to learn sth. Very Happy
shouldnt it be considered Style?
Re: FIX: ArrayCtrl to support Style [message #32067 is a reply to message #32065] Tue, 19 April 2011 23:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12015
Registered: November 2005
Ultimate Member
No.

Well, actually, perhaps colors itself should. But methods have different meaning.

Hint: Methods activate even-odd coloring, which is not active by default.

[Updated on: Tue, 19 April 2011 23:23]

Report message to a moderator

Re: FIX: ArrayCtrl to support Style [message #32076 is a reply to message #32067] Wed, 20 April 2011 11:01 Go to previous message
kohait00 is currently offline  kohait00
Messages: 934
Registered: July 2009
Location: Germany
Experienced Contributor
that's more clear now..
attached is a version that leaves all the api as is. the ArrayCtrl::Style has paper, ink and gridcolor now. which can be overridden by the local evenink, evenpaper, etc.. if not Null..
otherwise style stuff is used.

generally, the question is how to handle Style.

on one hand, it's great to have a one-colorset-fits-all-controls possibility (deriving stuff directly from SColor, which is still used in a lot of Ctrl's) and only specifying the 'additional extensions' in Style.

OTOH it is also good to let the colors used in a Ctrl be entirely overridable in Style, i.e like paper and ink and the like. they are initialized from the common chameleon color set but are changeable anytime at runtime by editing the global Style for that Ctrl family (or a separate Style instance for some Ctrl instances only).

up to now, the Upp Ctrl's are a mix of these 2 ways. maybe generalizing would help the usability for newcomers.
(want to deal with appearance -> take a look at Style).
  • Attachment: ArrayCtrl.h
    (Size: 26.26KB, Downloaded 196 times)
  • Attachment: ArrayCtrl.cpp
    (Size: 62.43KB, Downloaded 183 times)

[Updated on: Wed, 20 April 2011 11:03]

Report message to a moderator

Previous Topic: DropGrid improvement proposals
Next Topic: Simpler way to access Option in GridCtrl
Goto Forum:
  


Current Time: Mon Sep 16 06:06:00 CEST 2019

Total time taken to generate the page: 0.02113 seconds