Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Borders

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Borders
#2914
Posted by: lea 2003-11-19 19:22:00
Is there a possibility to change the colour of a border?
Like in Java the borderfactory?
It is possible to change the colour of the rect drawn with a static box?

Thanks
Message2. Re: Borders
#2919
Posted by: upCASE 2003-11-20 17:30:10
Hi!
Had a short look into the matter yesterday evening and did have any success. I guess it could be possible. I'll check again.
You can allways subclass from wxControl and write your own class that is capable of such things, but I'm not sure if you want to do this. Maybe there's some way of using an owner drawn class I missed.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Borders
#2922
Posted by: upCASE 2003-11-20 17:50:36
Hi!
Maybe this helps:
http://lists.wxwindows.org/archive/wxPython-users/msg01463.html

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message4. Re: Borders
#2928
Posted by: lea 2003-11-20 23:21:30
Thx again!
I will try it later, so much to do for now!
Message5. Re: Borders
#2940
Posted by: upCASE 2003-11-22 01:39:59
Hi!
Just played with my thoughts and your problem again...
There seems to be no way to do it directly, because wxWindows uses the underlaying API for creating static boxes.
Two ways should be possible:
1. Check the file wx/effects.h. The method wxEffects::DrawSunkenEdge() is very usefull as you could simply draw the border with your colours only by specifying the control to draw on.
Be aware that wxEffects doesn't seem to be documented in any way. I only found it while browsing the sources. I'm not sure if it will be there in future versions.

2. Subclass from wxControl and write your own static box. This isn't too complicated, but it can be a real pain... I know it for my wxSkin package subclassed wxControl all the time.

upcase
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message6. Re: Borders
#2947
Posted by: lea 2003-11-22 15:53:21
Thanks a lot!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥477.00 ·
 
 
¥918.00 ·
 
 
¥370.00 ·
 
 
¥271.00 ·
 
 
¥995.00 ·
 
 
¥1,580.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0