Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-11

TCanvas handle

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

I believe someone mentioned that they felt that the canvas' handle should point to a GC instead of the widget it points to now. I tend to agree with the small amount of investigation I spent on the subject.

I assume the GC will be gooten from the function call GETDC (which will call getgc for gtk). FHandle in TCanvas points to a HFont which is a longword (or something like that). I assume we'll simply type-cast it as a GC and it'll work in gtkinterface.

Is anyone planning on working on this?
I see someone posted the bitmap code but there are a ton of errors because a new VCLGLOBALS wasn't posted that included such things as CSBITMAP and the like. Whomever did this, please fix it so it compiles again. If you need help, let us know.

I would like to get a snapshot of what is being worked on so we can move forward with getting this editor working. We have a lot of functions we need to add.

Please let me know if the getdc functions are being written and if the canvas stuff is being re-written to support fhandle. I have to look over the new setup we have with the new include files. I haven't had time to investigate them yet to see if this is a better way.

Before making a drastic change like this, I think we should disuss it a bit more........ :-)

happy coding...
Shane

Reply by email

Marc Weustink
to Shane Miller
shane wrote
I believe someone mentioned that they felt that the canvas' handle should

point to a GC instead of the widget it points to now. I tend to agree with the small amount of investigation I spent on the subject.

That was me.

I assume the GC will be gooten from the function call GETDC (which will

call getgc for gtk).

FHandle in TCanvas points to a HFont which is a longword (or something

like that). I assume we'll simply type-cast it as a GC and it'll work in gtkinterface.

I already started some experiments/implements on that. Just a GC isn't enough. You also need a window. Just look at the code I've committed for GetDC in gtkwinapi.inc

Is anyone planning on working on this?

Yes, From the results I've now it looks promising.

I see someone posted the bitmap code but there are a ton of errors because

a new VCLGLOBALS wasn't posted that included such things as CSBITMAP and the like. Whomever did this, please fix it so it compiles again. If you need help, let us know.

EEhhh... I guess I committed some changes to much. As soon as I've cleaned up the mess I'll commit the rest. I think this part of bitmap code (just the canvas) was also from me.
This all was an attempt to get mwEdit to accept text and draw lines and stuff, and add some mere WINAPI stuff. The raw ideas for the bitmap canvas where accidently commited as well.
To fix this (I guess by head), simply comment out all csBitmap code in CreateComponent (gtkobject.inc)

I would like to get a snapshot of what is being worked on so we can move

forward with getting this editor working. We have a lot of functions we need to add.

Please let me know if the getdc functions are being written and if the

canvas stuff is being re-written to support fhandle.

This moment I'm working on the DC/Canvas/winapi stuff.

I have to look over the new setup we have with the new include files. I

haven't had time to investigate them yet to see if this is a better way.

Before making a drastic change like this, I think we should disuss it a

bit more........ :-)

Ok, OK it got a bit out of hand. It were all little changes, but in the end its huge.

It started with mwEdit problems, then fonts came, then DC then Canvas. Everything just comes together. Maybe I did some things to fast.

Marc

Reply by email

Marc Weustink
to Shane Miller: Here is the list we started with. Number 6 is done. Any changes on any of the others?…
you wrote
Here is the list we started with. Number 6 is done. Any changes on any of the others?

Yup,

number 3.
All functions are there, most of them not implemented yet, but I see no problems in doing that.
GetDC/ReleaseDC are functional (not finished)
I allready got some ideas (and started a bit) how to implement GetObject/SelectObject/DeleteObject.
Same counts for CreateFontIndirect and GetTextMetrics

number 4.
That a problem with the compiler, not allowing a default parameter. The last parameter is Endbles which is default true. I'll try if I can fix this whit an overload.

number 7.
Also got an idea here, but I've to investigate more.

BTW, I cleaned up the mess here and I committed the whole. Lazarus should compile now. I moved mwEdit to another TestForm, which shows up after pressing the testform button.
TestForm has 2 buttons, one drawing some rectangles through DC, another placing text in the mwEdit. This results in some error messages, this is because the TBitmapcanvas DC has yet no valid GC (this will be the case when SelectObject is finished)

Marc

Show quoted text 149 lines
1) Fix the following which does not work for some reason: Font.OnChange := @FontChanged 2) Write the implementation for LoadFromResourceName to load the Mark bitmaps. 3) Write a replacement function for the following Windows functions: GetObject CreateFontIndirect GetDC SelectObject GetTextMetrics ReleaseDC DeleteObject HideCaret GetSystemMetrics ExtTextOut ShowCaret SetCaretPos SetScrollInfo ShowScrollBar 4) Fix Draw method parameter list of TImageList to match Delphi parameter list. 5) Create a way to perform the following action: inherited Font := Value where Value is a TFont. DONE temporarily---6) Add Pitch to the TFont object. 7) Write a RecreateWnd method. 8) Create the following methods in the parent object (TCustomControl): WMKillFocus WMNCHitTest WMSetFocus WMSize mwhighlighter.pas 1) Write Registry or Ini file code to replace RegOpenKeyEx. mwpassyn.pas 1) Fix compiler bug so it will call a function that is being pointed to by an array variable. ------------------------------------------------------------ Shane Miller Get paid to surf the net! http://alladvantage.com/go.asp?refid=DEX-870 Home page : http://www.lakefield.net/~smiller Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard Lazarus : http://www.miraclec.com/lazarus ---------------------------------------------------------- -----Original Message----- From: Marc Weustink To: Date: Tuesday, November 16, 1999 2:19 PM Subject: Re: [lazarus] TCanvas handle >At 15:24 16-11-99 -0600, shane wrote: >>I believe someone mentioned that they felt that the canvas' handle should >point to a GC instead of the widget it points to now. I tend to agree with >the small amount of investigation I spent on the subject. > >That was me. > >> >>I assume the GC will be gooten from the function call GETDC (which will >call getgc for gtk). >>FHandle in TCanvas points to a HFont which is a longword (or something >like that). I assume we'll simply type-cast it as a GC and it'll work in >gtkinterface. > >I already started some experiments/implements on that. Just a GC isn't >enough. You also need a window. Just look at the code I've committed for >GetDC in gtkwinapi.inc > >>Is anyone planning on working on this? > >Yes, From the results I've now it looks promising. > >>I see someone posted the bitmap code but there are a ton of errors because >a new VCLGLOBALS wasn't posted that included such things as CSBITMAP and >the like. Whomever did this, please fix it so it compiles again. If you >need help, let us know. > >EEhhh... I guess I committed some changes to much. As soon as I've cleaned >up the mess I'll commit the rest. I think this part of bitmap code (just >the canvas) was also from me. >This all was an attempt to get mwEdit to accept text and draw lines and >stuff, and add some mere WINAPI stuff. The raw ideas for the bitmap canvas >where accidently commited as well. >To fix this (I guess by head), simply comment out all csBitmap code in >CreateComponent (gtkobject.inc) > > >>I would like to get a snapshot of what is being worked on so we can move >forward with getting this editor working. We have a lot of functions we >need to add. > >>Please let me know if the getdc functions are being written and if the >canvas stuff is being re-written to support fhandle. > >This moment I'm working on the DC/Canvas/winapi stuff. > >>I have to look over the new setup we have with the new include files. I >haven't had time to investigate them yet to see if this is a better way. > > >> >>Before making a drastic change like this, I think we should disuss it a >bit more........ :-) > >Ok, OK it got a bit out of hand. It were all little changes, but in the end >its huge. > >It started with mwEdit problems, then fonts came, then DC then Canvas. >Everything just comes together. Maybe I did some things to fast. > >Marc > > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus > _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Shane Miller: I believe someone mentioned that they felt that the canvas' handle should point to a GC…

+ From: Shane Miller
+
+ I assume the GC will be gooten from the function call GETDC
+ (which will call getgc for gtk).
+ FHandle in TCanvas points to a HFont which is a longword (or
+ something like that).
+ I assume we'll simply type-cast it as a GC and it'll work in
+ gtkinterface.

I yust noticed the use of HFONT as GC.
Is far I understand the docs, you use gdk_gc_set_font to 'select' a font in a GC. You can't use a font as GC.

Marc

Reply by email

Shane Miller

Here is the list we started with. Number 6 is done. Any changes on any of the others?

1) Fix the following which does not work for some reason:
       Font.OnChange := @FontChanged

2) Write the implementation for LoadFromResourceName to load the Mark bitmaps.

3) Write a replacement function for the following Windows functions: GetObject
CreateFontIndirect
GetDC
SelectObject
GetTextMetrics
ReleaseDC
DeleteObject
HideCaret
GetSystemMetrics
ExtTextOut
ShowCaret
SetCaretPos
SetScrollInfo
ShowScrollBar

4) Fix Draw method parameter list of TImageList to match Delphi parameter list.

5) Create a way to perform the following action:

       inherited Font := Value
    where Value is a TFont.

DONE temporarily---6) Add Pitch to the TFont object.

7) Write a RecreateWnd method.

8) Create the following methods in the parent object (TCustomControl): WMKillFocus
WMNCHitTest
WMSetFocus
WMSize

mwhighlighter.pas

1) Write Registry or Ini file code to replace RegOpenKeyEx.

mwpassyn.pas

1) Fix compiler bug so it will call a function that is being pointed to by an
array variable.

------------------------------------------------------------ Shane Miller

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.lakefield.net/~smiller/autoip

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.miraclec.com/lazarus
----------------------------------------------------------

Earlier message 75 lines
-----Original Message----- From: Marc Weustink To: Date: Tuesday, November 16, 1999 2:19 PM Subject: Re: [lazarus] TCanvas handle >At 15:24 16-11-99 -0600, shane wrote: >>I believe someone mentioned that they felt that the canvas' handle should >point to a GC instead of the widget it points to now. I tend to agree with >the small amount of investigation I spent on the subject. > >That was me. > >> >>I assume the GC will be gooten from the function call GETDC (which will >call getgc for gtk). >>FHandle in TCanvas points to a HFont which is a longword (or something >like that). I assume we'll simply type-cast it as a GC and it'll work in >gtkinterface. > >I already started some experiments/implements on that. Just a GC isn't >enough. You also need a window. Just look at the code I've committed for >GetDC in gtkwinapi.inc > >>Is anyone planning on working on this? > >Yes, From the results I've now it looks promising. > >>I see someone posted the bitmap code but there are a ton of errors because >a new VCLGLOBALS wasn't posted that included such things as CSBITMAP and >the like. Whomever did this, please fix it so it compiles again. If you >need help, let us know. > >EEhhh... I guess I committed some changes to much. As soon as I've cleaned >up the mess I'll commit the rest. I think this part of bitmap code (just >the canvas) was also from me. >This all was an attempt to get mwEdit to accept text and draw lines and >stuff, and add some mere WINAPI stuff. The raw ideas for the bitmap canvas >where accidently commited as well. >To fix this (I guess by head), simply comment out all csBitmap code in >CreateComponent (gtkobject.inc) > > >>I would like to get a snapshot of what is being worked on so we can move >forward with getting this editor working. We have a lot of functions we >need to add. > >>Please let me know if the getdc functions are being written and if the >canvas stuff is being re-written to support fhandle. > >This moment I'm working on the DC/Canvas/winapi stuff. > >>I have to look over the new setup we have with the new include files. I >haven't had time to investigate them yet to see if this is a better way. > > >> >>Before making a drastic change like this, I think we should disuss it a >bit more........ :-) > >Ok, OK it got a bit out of hand. It were all little changes, but in the end >its huge. > >It started with mwEdit problems, then fonts came, then DC then Canvas. >Everything just comes together. Maybe I did some things to fast. > >Marc > > >_________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email