Sign in Join

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

Mailing lists / lazarus / 2002-08

native Win32 Interface BugFix, maybe

11 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Markus Lüdin
to Keith Bowes: I added this code a couple days ago because forms are always too small. It's a hack until…
Show quoted text 9 lines
>// if Sender is TCustomForm then >// begin >// inc(Width, 50); >// inc(Height, 50); >// end; > I added this code a couple days ago because forms are always too small. It's a hack until somebody can figure out why it happens.

This issue is also solved with the updated WM_SIZE and WM_MOVE they form got smaller because it got reduced to the client area...but that does not happen anymore
so you can delete that....

Attached is my work from today...I made the CreatePixmapIndirect work. I tested it with
the bitbutton demo and the splash screen, both seem to work now....but it could be a bit faster,
at least it works now :)..if someone could check and add to the cvs....thanks.

Regards
Markus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bin00000.bin
Type: application/octet-stream
Size: 6763 bytes
Desc: "CreatePixmapIndirect.pp"
Url : http://localhost/pipermail/lazarus/attachments/20020829/c120335c/bin00000.bin

Reply by email

Andrew Johnson
I made the CreatePixmapIndirect work.

While, as you say, it is a slow solution, it is very needed. If you want to look into it, we also really need a similar hack for saving TBitmap/TPixmap to a Pixmap Stream/File. This is needed for both Windows and Linux to get saving Pixmaps etc. to lfm files working. Given how really generic a solution CreatePixmapIndirect is, that is, to get it to work under the GTK interface all I'd have to do is modify about three lines, a similar solution for saving should also be simple to add to both the GTK and Win32 Interfaces.

Andrew

_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

Reply by email

Andrew Johnson
Maybe it looks small because probably the examples were designed with the gtk widgets and maybe they are different sized than the win32 ones?

While I haven't had a chance too test the new code, I am farely certain you are right. In GTK Form Width and Height represent a Forms modifiable Size, that is it is Width x Height not counting Window Borders/TitleBar, this is sort of like what the ClientArea for Forms is on Windows. On Windows Width x Height represent the size including Window Borders/Titlebars. As a Result of this a Form of 100x100 in GTK is something like a form of 115x125 on Windows. so any form desginged with GTK sizes in mind, will look just a little too small under windows. The best way to take care of this is to make ClientWidth/ClientHeight work properly, and use these values instead... This is also not entirely correct, but a lot of thought will need to be put into how to make values match as closely as possible between the two interfaces, once the Win32 interface is more complete.

Andew

_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com

Reply by email

Markus Lüdin
to Keith Bowes: I added this code a couple days ago because forms are always too small. It's a hack until…

Another Question, I can compile lazarus with the native win32 interface but all
I get is the splash screen I think, just an empty window. When I click it the window
goes away and it hangs...does it work the same for you? or is it a build problem i.e.
I do something wrong?
If it is an interface problem could you give me an idea in which area I should start looking?

Regards
Markus

Reply by email

Michal Bukovjan
to Keith Bowes: I added this code a couple days ago because forms are always too small. It's a hack until…
Markus L�din wrote 29 lines
>>// if Sender is TCustomForm then >>// begin >>// inc(Width, 50); >>// inc(Height, 50); >>// end; >> >> >> >I added this code a couple days ago because forms are always too small. >It's a hack until somebody can figure out why it happens. > > This issue is also solved with the updated WM_SIZE and WM_MOVE they form got smaller because it got reduced to the client area...but that does not happen anymore so you can delete that.... Attached is my work from today...I made the CreatePixmapIndirect work. I tested it with the bitbutton demo and the splash screen, both seem to work now....but it could be a bit faster, at least it works now :)..if someone could check and add to the cvs....thanks. Regards Markus

Done.

Would you consider using patch files in the future?

cvs diff -u [filename...] >my_shiny_new_patch.patch

is our friend...

Michal

Reply by email

Keith Bowes
Show quoted text 26 lines
From: Markus L�din Hi All I'm playing around with the native win32 interface and my compiled examples were always jumping around when I resized or moved them...so I spent some hours reading code and debuging the win32 Interface and I found following solution for the problem...I only hope it's not something that's already fixed :-) Because I used the daily sources and no the cvs access.....*pray* Could somone check that? And maybe add this changes to the cvs tree? Regards Markus File: win32object.inc procedure: TWin32Object.ResizeChild comment: Probably some debug code... changes: // if Sender is TCustomForm then // begin // inc(Width, 50); // inc(Height, 50); // end;

I added this code a couple days ago because forms are always too small. It's a hack until somebody can figure out why it happens.

Show quoted text 33 lines
File: win32callback.inc procedure: WindowProc comments: WM_SIZE and WM_MOVE return the new Client Size and Client Pos in LParam not the Window Size!!! so i call GetWindowRect and get the window size.... changes: WM_SIZE: Begin Windows.GetWindowRect(Window, @Rect); With TLMSize(LMessage) Do Begin Msg := LM_SIZE; SizeType := WParam; Width := Rect.Right-Rect.Left; Height := Rect.Bottom-Rect.Top; End; End; WM_MOVE: Begin Windows.GetWindowRect(Window, @Rect); With TLMMove(LMessage) Do Begin Msg := LM_MOVE; // MoveType := WParam; WParam is not defined! MoveType := 0; XPos := Rect.Left; YPos := Rect.Top; End; End;

Thanks, the forms don't jump around a lot now. Your changes have been committed.

_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

Reply by email

Markus Lüdin
to Keith Bowes: It's not as small as it used to be, but it still seems a little smaller than it should…
Show quoted text 10 lines
>From: Markus L�din > > > >// if Sender is TCustomForm then > > >// begin > > >// inc(Width, 50); > > >// inc(Height, 50); > > >// end; > > > > > > > I added this code a couple days ago because forms are always too

small.

Show quoted text 8 lines
> > It's a hack until somebody can figure out why it happens. > >This issue is also solved with the updated WM_SIZE and WM_MOVE they form >got smaller because it got reduced to the client area...but that does not >happen anymore >so you can delete that.... It's not as small as it used to be, but it still seems a little smaller

than

it should be. But since you know more this than I do, I've taken your

word

that it's the right size and removed the code.

I checked the Forms width and high with the actual pixel size on the screen, and
it was correct, although I just tested it with one example programm. Maybe it looks
small because probably the examples were designed with the gtk widgets and maybe
they are different sized than the win32 ones?

Reply by email

Markus Lüdin
to Andrew Johnson: On Thu, 29 Aug 2002 19:45:19 +0200 While, as you say, it is a slow solution, it is very…
While, as you say, it is a slow solution, it is very needed. If you want

to

look into it, we also really need a similar hack for saving

TBitmap/TPixmap

to a Pixmap Stream/File. This is needed for both Windows and Linux to get saving Pixmaps etc. to lfm files working.

I don't know what has more priority but right now I try to help to get the Win32 Interface going....so maybe once I get bored of it I'll have a look at that :-)

Markus

PS: Maybe some introduction, since I'm new to this list. I like the idea of having
a Open Source and Multi Platform RAD System that's why I try to help. I'm 27, software engineer and life in Switzerland but will move to Indiana,USA soon
because my wife is from there...

Reply by email

Keith Bowes
Show quoted text 16 lines
From: Markus L�din > >// if Sender is TCustomForm then > >// begin > >// inc(Width, 50); > >// inc(Height, 50); > >// end; > > > > I added this code a couple days ago because forms are always too small. > It's a hack until somebody can figure out why it happens. This issue is also solved with the updated WM_SIZE and WM_MOVE they form got smaller because it got reduced to the client area...but that does not happen anymore so you can delete that....

It's not as small as it used to be, but it still seems a little smaller than it should be. But since you know more this than I do, I've taken your word that it's the right size and removed the code.

_________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx

Reply by email