472,992 Members | 3,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

A couple of questions on OGL

Hi everybody,

I am developing a little graph editor using python 2.5 and wx 2.8. Whenever I try to add text to a line shape I get a big rectangle on the background which covers the shapes. Is there a way to render the text on a transparent background? I googled and found the same question in several places, but no answers :)

The second thing is: If I am drawing a lineshape as an spline, control points are fixed. Is there a way to update the position of this control points when I move the shapes which are connected to the line?

Thanks!
Jul 10 '07 #1
5 1251
bartonc
6,596 Expert 4TB
Sorry, wildjack. I'm not much of a graphics guy.


I am very interested in feedback on Boa 0.6. I've yet to try switching for 0.5.2 (right in the middle of a big project), but would do it if I heard a few more positive experiences getting the installation to work.

Keep in touch.
Jul 11 '07 #2
Hi Barton,

Although I have previous experience with other languages, I'm new to Python (only a few weeks developing things). I began by installing 0.4.4 to give it a try and started developing this graph editor I commented before. I really liked the IDE, so I checked out 0.6.0 from sourceforge CVS and kept on developing with it. The switch was almost seamless. There was some deprecated stuff in the generated code which wouldn't work with the designer, but substituted the code which wasn't working in a few minutes and everything started running again. As for the rest, 0.6.0 runs smoothly. So far, I haven't experienced any problems with it ( Anyway, take into account that I'm working on a small thing, ~3500 lines). If you have further questions, I'll be glad to help :)

Best regards,
Wildjack
Jul 11 '07 #3
bartonc
6,596 Expert 4TB
Hi Barton,

Although I have previous experience with other languages, I'm new to Python (only a few weeks developing things). I began by installing 0.4.4 to give it a try and started developing this graph editor I commented before. I really liked the IDE, so I checked out 0.6.0 from sourceforge CVS and kept on developing with it. The switch was almost seamless. There was some deprecated stuff in the generated code which wouldn't work with the designer, but substituted the code which wasn't working in a few minutes and everything started running again. As for the rest, 0.6.0 runs smoothly. So far, I haven't experienced any problems with it ( Anyway, take into account that I'm working on a small thing, ~3500 lines). If you have further questions, I'll be glad to help :)

Best regards,
Wildjack
Thanks Wildjack. I'd definitely appreciate you hanging around the forum a bit. I've been use Boa 0.5.2 for about 9 months and contribute to its development in some small ways (tiny code updates when I find them) so you are actually running a bit of my work. I just get nervous, changing tools in the middle of a project. It truly is a great piece of software. Saves me hours of layout and I've gotten good at adding to & reusing the generated code without upsetting the designer. Tons o' fun!

Keep in touch.
Jul 11 '07 #4
Ok, finally I figured out a way to solve the transparent bg problem for text in lineshapes:

* First we create our own line class inheriting from LineShape.


* Then we override the DrawRegion method, and we comment out the line marked with *** like this:
Expand|Select|Wrap|Line Numbers
  1. def DrawRegion(self, dc, region, x, y):
  2.         """Format one region at this position."""
  3.         if self.GetDisableLabel():
  4.             return
  5.  
  6.         w, h = region.GetSize()
  7.  
  8.         # Get offset from x, y
  9.         xx, yy = region.GetPosition()
  10.  
  11.         xp = xx + x
  12.         yp = yy + y
  13.  
  14.         # First, clear a rectangle for the text IF there is any
  15.         if len(region.GetFormattedText()):
  16.             dc.SetPen(self.GetBackgroundPen())
  17.             dc.SetBrush(self.GetBackgroundBrush())
  18.  
  19.             # Now draw the text
  20.             if region.GetFont():
  21.                 dc.SetFont(region.GetFont())
  22.   ****         #dc.DrawRectangle(xp - w / 2.0, yp - h / 2.0, w, h)
  23.  
  24.                 if self._pen:
  25.                     dc.SetPen(self._pen)
  26.                 dc.SetTextForeground(region.GetActualColourObject())
  27.  
  28.                 DrawFormattedText(dc, region.GetFormattedText(), xp, yp, w, h, region.GetFormatMode())

This quick fix worked for me. So far everything seems to work fine. As for the line control points problem, I have managed to create control points with handles to move them manually (it's not what I intended to do but it is ok for the moment).
Jul 15 '07 #5
bartonc
6,596 Expert 4TB
Thanks for the OGL update, Wildjack.

Also, I made the upgrade to Boa Constructio 0.6.1. Works great (after I rebooted my machine). Thanks again.
Jul 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: bjs | last post by:
I hope I've got the right group here and apologies if I haven't. I'm a hobby programmer and have just upgraded to Visual Basic.net and have a couple of questions if anybody can help. In VB 6...
1
by: hoochiegooch | last post by:
Hi, all. I have a couple of questions about NAnt. 1. Is there a better way to invoke NAnt from a C# "Master Test Rig" than shelling out? IOW, how should an ASP.NET web app or Windows Service...
21
by: Rob Somers | last post by:
Hey people, I read a good thread on here regarding the reason why we use function prototypes, and it answered most of my questions, but I wanted to double check on a couple of things, as I am...
1
by: dln | last post by:
Howdy. I'm a bit new to C# and got a couple of quick questions that perhaps someone can help me answer. First, is there a property that you set on a TextBox control that will force the control to...
4
by: Sccr18 | last post by:
I just have a couple of easy questions: 1. In Asp.net using Vb is there a way to list all the possible characters without listing them all like Char() = "abc..."? 2. I was trying to set the focus...
3
by: punt | last post by:
I've got a couple of questions about a deployed VB.NET application. Firstly can a deployed application remember any variables(single string) after being closed down and re-opened, without the use...
0
by: Marc | last post by:
Hi, I'm working with a customer that is trying to find a solution to provide geographical redundancy. Our application is currently using IBM DB2 v8.2. I have a couple of questions with regards...
3
by: Ron | last post by:
Hello everyone, I have a couple of questions really quick questions. I am creating a dispatch database. What I would really like to do is have to option of automatically inserting the time...
3
by: melton9 | last post by:
I'm just getting into using datagrid and have a couple of questions. 1.)How do you get the grid to show the values of a datatable automatically? Currently I have to hit the + sign and then...
0
by: Newish | last post by:
Hi Couple of questions on datagrid 1) Is there a performance issue when using datagrid to display data from a datatable. 2) Is there a security issue when using datagrid to display data...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.