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 » Community » U++ community news and announcements » Upp 2007.1beta2 released
Re: Upp 2007.1beta2 released [message #7837 is a reply to message #7827] Thu, 25 January 2007 12:10 Go to previous messageGo to previous message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member

Quote:

The problem is that there is no function available to get that individual color in Gtk API - you have to retrieve the pointer to the whole structure. Current U++ is designed to avoid including any Gtk headers, so we have to recreate the structure (see CtrlLib/ChGtk.cpp, beginning of file... Sad ). If layout changes between Gtk versions, we are in trouble...


Tried to get the hang of it last night.
So I started to replace some pointer arithmetics with proper data structures, to make things a bit less obfuscated.
Didn't understand how you calculated the style offset, as the data we are interested in starts right at offset 0.
'Twas late at night. For lack of familiarity with the upp::Draw properties and chameleon properties (paper,face ...) I didn't get farther than this:

struct G_color { dword _; word r, g, b; };

enum { G_STATE_NORMAL, G_STATE_ACTIVE, G_STATE_PRELIGHT, G_STATE_SELECTED, G_STATE_INSENSITIVE };

// G_STATE_NORMAL -> CTRL_NORMAL
// G_STATE_PRELIGHT -> CTRL_HOT 
// G_STATE_ACTIVE -> CTRL_PRESSED
// G_STATE_SELECTED -> ??
// G_STATE_INSENSITIVE -> CTRL_DISABLED

struct G_style {
  G_Color fg[5];
  G_Color bg[5];
  G_Color light[5];
  G_Color dark[5];
  G_Color mid[5];
  G_Color text[5];
  G_Color base[5];
  G_Color text_aa[5];		/* Halfway between text/base */
  
  G_Color black;
  G_Color white;
};


I concluded, if I knew how things mapped to upp, I could have done it. But I must have overlooked something, if you couldn't get it done, I suppose.

Guido
 
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: Forum email trouble....
Next Topic: Upp 2007.2rc1 released
Goto Forum:
  


Current Time: Fri Jun 27 12:58:30 CEST 2025

Total time taken to generate the page: 0.02901 seconds