Sign in Join

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

Mailing lists / lazarus / 2008-02

WinCE: LCL bugs?

21 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

denisgolovan

Hi, all.

When I build for wince on linux using arm-wince crosscompiler, everything seem to be ok. Except main window height(it is too large) and close button(application just disappears and hangs). Maybe some workaround?

PocketPC - A63x architecture (ARM, of course), FPC 2.3.1 svn, Lazarus svn.

Regards, Denis

Reply by email

Felipe Monteiro de Carvalho
to denisgolovan
denisgolovan wrote
When I build for wince on linux using arm-wince crosscompiler, everything seem to be ok. Except main window height(it is too large)

Define too large. We just use what WindowsCE offer as default for us.

From wincewsforms.pp:
    if (BorderStyle  bsDialog) and (BorderStyle  bsNone) then
    begin
      Left:=CW_USEDEFAULT;
      Top:=CW_USEDEFAULT;
      Height:=CW_USEDEFAULT;
      Width:=CW_USEDEFAULT;
    end
    else
      //TODO:little bit dirty but works, why the captionbar height is
taken from height ? what flag does that ?
      Height := Height+25;
and close button(application just disappears and hangs). Maybe some workaround?

How do you know it hangs?

The close button doesn't kill the application because Windows CE doesn't want it (it doesn't send a WM_CLOSE message). If you want to kill the app set a OnClose event handler and use
Application.Terminate.

There is some discussion to change that, but no working alternative was found yet.

PocketPC - A63x architecture (ARM, of course), FPC 2.3.1 svn, Lazarus svn.

I see you are using subversion, and that's very oportune, because I did a lot of changes very recently and having someone that can test them is great =)

For example the wince interface should now be fully unicode. I also fixed getting system default colors.

thanks,

Felipe Monteiro de Carvalho

Reply by email

zaher dirkey
to Felipe Monteiro de Carvalho

I Use this to fit in the screen.

-----------
procedure Resize; override;
procedure TForm1.Resize;
var
  r:TRect;
begin
  inherited Resize;
  {$IFDEF WINCE}
  SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);
//  r := Rect(0, 0, GetSystemMetrics(SM_CXFULLSCREEN) ,
GetSystemMetrics(SM_CYFULLSCREEN));
  ClientHeight := GetSystemMetrics(SM_CYFULLSCREEN);
  ClientWidth := GetSystemMetrics(SM_CXFULLSCREEN) +
GetSystemMetrics(SM_CXBORDER) * 2;
//  BoundsRect := r;
  {$ENDIF}
end;
-------------

On Feb 18, 2008 12:19 AM, Felipe Monteiro de Carvalho <

Show quoted text 52 lines
wrote: On Feb 17, 2008 10:51 PM, denisgolovan wrote: > When I build for wince on linux using arm-wince crosscompiler, everything seem to be ok. Except main window height(it is too large) Define too large. We just use what WindowsCE offer as default for us. >From wincewsforms.pp: if (BorderStyle bsDialog) and (BorderStyle bsNone) then begin Left:=CW_USEDEFAULT; Top:=CW_USEDEFAULT; Height:=CW_USEDEFAULT; Width:=CW_USEDEFAULT; end else //TODO:little bit dirty but works, why the captionbar height is taken from height ? what flag does that ? Height := Height+25; > and close button(application just disappears and hangs). Maybe some workaround? How do you know it hangs? The close button doesn't kill the application because Windows CE doesn't want it (it doesn't send a WM_CLOSE message). If you want to kill the app set a OnClose event handler and use Application.Terminate. There is some discussion to change that, but no working alternative was found yet. > PocketPC - A63x architecture (ARM, of course), FPC 2.3.1 svn, Lazarus svn. I see you are using subversion, and that's very oportune, because I did a lot of changes very recently and having someone that can test them is great =) For example the wince interface should now be fully unicode. I also fixed getting system default colors. thanks, -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/678926e5/attachment.html

Reply by email

denisgolovan
Define too large. We just use what WindowsCE offer as default for us.

I decided you better watch yourself :). See attachment At the bottom, AFAIU, there is a horizontal scrollbar, but system bottom panel (I don't know panel name :)) is half visible (rather strange effect)

> and close button(application just disappears and hangs). Maybe some workaround? How do you know it hangs?

Well, I hardly can close it using WinCE Task Manager.

The close button doesn't kill the application because Windows CE doesn't want it (it doesn't send a WM_CLOSE message). If you want to kill the app set a OnClose event handler and use Application.Terminate.
Tried:
procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  Application.Terminate;
end;

... but no use. Again window just disappears and application stays running.

Show quoted text 6 lines
There is some discussion to change that, but no working alternative was found yet. I see you are using subversion, and that's very oportune, because I did a lot of changes very recently and having someone that can test them is great =)

Glad to help :)

For example the wince interface should now be fully unicode.

Well, than, maybe, something must be done to Lazarus application codepage, because using russian chars in panel caption gives only "unpleasant" symbols :). Again see screenshot :)

I also fixed getting system default colors.

Colors seem ok.

P.S. Ctrl+F9, Ctrl+F2 and so on shortcuts still do not work :( (Lazarus GTK interface). People say, something in system settings. Somebody help :)

Regards,
Denis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture.jpg
Type: image/jpeg
Size: 7372 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/101c092b/attachment.jpg

Reply by email

denisgolovan
Show quoted text 23 lines
I Use this to fit in the screen. ----------- procedure Resize; override; procedure TForm1.Resize; var r:TRect; begin inherited Resize; {$IFDEF WINCE} SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0); // r := Rect(0, 0, GetSystemMetrics(SM_CXFULLSCREEN) , GetSystemMetrics(SM_CYFULLSCREEN)); ClientHeight := GetSystemMetrics(SM_CYFULLSCREEN); ClientWidth := GetSystemMetrics(SM_CXFULLSCREEN) + GetSystemMetrics(SM_CXBORDER) * 2; // BoundsRect := r; {$ENDIF} end; -- Zaher Dirkey

A little better sizing, but still...
See screenshot.
Thanks for help.

Regards,
Denis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture.jpg
Type: image/jpeg
Size: 7362 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/06605523/attachment.jpg

Reply by email

Felipe Monteiro de Carvalho
to denisgolovan: I decided you better watch yourself :). See attachment At the bottom, AFAIU, there is a…

2008/2/18 denisgolovan :

I decided you better watch yourself :). See attachment At the bottom, AFAIU, there is a horizontal scrollbar, but system bottom panel (I don't know panel name :)) is half visible (rather strange effect)

I don't use wince a lot (I don't really have a device). Do other applications cover that bottom panel or do they leave it intact?

... but no use. Again window just disappears and application stays running.

But that is what Windows CE wants ... I think that OnClose also isn't called because Windows CE won't send a WM_CLOSE message unless you are out of memory.

Some people want the app to do like WinCE wants, then we need to provide a mechanism to detect on startup if another instance is already running and wake up the old instance instead of running a new one if so.

Some people want the app to do like on other widgetsets: just close. Then we need an way to detect that. WM_CLOSE doesn't work. And we also need a mechanism to override that.

Well, than, maybe, something must be done to Lazarus application codepage, because using russian chars in panel caption gives only "unpleasant" symbols :). Again see screenshot :)

Rebuild your IDE using gtk2 to develop on a unicode environment:

cd lazarus
make clean all LCL_PLATFORM=gtk2

Gtk 1 will never be a unicode widgetset because it has inconsistent internationalization support:

http://wiki.lazarus.freepascal.org/Lazarus_known_issues_%28things_that_will_never_be_fixed%29#Inconsistent_internationalization_support

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

The answer I got there about the X button:

<quote>
It's very well documented and covered that the [X] is *not* a close, but a minimize button. Turn off the minimize to chage it to [ok] and it will close the window, allowing you to catch WM_CLOSE, or search for "smart minimize"
</quote>

Felipe Monteiro de Carvalho

Reply by email

zaher dirkey
to Felipe Monteiro de Carvalho

Thanks a lot :),
Can i use Dialogs to call MessageBox/ShowMessage or it still need to fix, I tried to get in the source for WinCE but that make some conflict with what idea behind WindowState and FormStyle in WinCE.

In fact i hate the properties of FormStyle even in Win32 (hating started With Delphi 2).

Thanks again.

On Feb 18, 2008 3:55 PM, Felipe Monteiro de Carvalho <

Show quoted text 17 lines
wrote: 2008/2/18 denisgolovan : > I decided you better watch yourself :). See attachment > At the bottom, AFAIU, there is a horizontal scrollbar, but system bottom panel (I don't know panel name :)) is half visible (rather strange effect) I think it's now fixed ... please update svn and retest. -- Felipe Monteiro de Carvalho _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/3285fc4c/attachment.html

Reply by email

denisgolovan
Show quoted text 6 lines
2008/2/18 denisgolovan : > I decided you better watch yourself :). See attachment > At the bottom, AFAIU, there is a horizontal scrollbar, but system bottom panel (I don't know panel name :)) is half >visible (rather strange effect) I don't use wince a lot (I don't really have a device). Do other applications cover that bottom panel or do they leave it intact?

Yes, most applications seem to leave bottom panel visible. See screenshot

Show quoted text 5 lines
> ... but no use. Again window just disappears and application stays running. But that is what Windows CE wants ... I think that OnClose also isn't called because Windows CE won't send a WM_CLOSE message unless you are out of memory.

Sad story :(

Show quoted text 7 lines
Some people want the app to do like WinCE wants, then we need to provide a mechanism to detect on startup if another instance is already running and wake up the old instance instead of running a new one if so. Some people want the app to do like on other widgetsets: just close. Then we need an way to detect that. WM_CLOSE doesn't work. And we also need a mechanism to override that.

Yes, it seem that such mechanism is needed. Can I help you something... to make it work?

Show quoted text 6 lines
> Well, than, maybe, something must be done to Lazarus application codepage, because using russian chars in panel caption >gives only "unpleasant" symbols :). Again see screenshot :) Rebuild your IDE using gtk2 to develop on a unicode environment: cd lazarus make clean all LCL_PLATFORM=gtk2

Did, as you've said. Really. Nothing changed. In design-time I see my russian chars properly (UTF-8 locale), but on WinCE those symbols (seems WinCE wants cp1251 charset?)

Gtk 1 will never be a unicode widgetset because it has inconsistent internationalization support: http://wiki.lazarus.freepascal.org/Lazarus_known_issues_%28things_that_will_never_be_fixed%29#Inconsistent_internationalization_support

Hm. I didn't catch you. Wince (windows mobile) uses wince widgetset? Why Gtk1 problems appear?

-- Felipe Monteiro de Carvalho

Regards,
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture.jpg
Type: image/jpeg
Size: 15194 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/4b390527/attachment.jpg

Reply by email

denisgolovan
> At the bottom, AFAIU, there is a horizontal scrollbar, but system bottom panel (I don't know panel name :)) is half >visible (rather strange effect) I think it's now fixed ... please update svn and retest.

Well, much better now. Thanks. But grid scrollbar is still too low :(. See screenshot (next time will be a movie :)))) ) ============================================================================== r14182 | sekelsenmat | 2008-02-18 15:53:41 +0200 (???, 18 ??? 2008) | 1 line Several upgrades for device selection and form position/size on wince. ============================================================================== That's it?

Wrong codepage problem disappeared o_O. You did something? Or maybe full rebuild helped?

Regards,
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture.jpg
Type: image/jpeg
Size: 7567 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/156b6436/attachment-0001.jpg

Reply by email

zaher dirkey
to Felipe Monteiro de Carvalho: 2008/2/18 zaher dirkey : Sorry, I don't understand your sentence. Can you reformulate?…

I want to make Message Box, this message not fit to the screens, as like any message in Windows CE (for example delete a file), but in lazarus the message have incorrect size/position.
That depend on BorderStyle (i mistaked).

ShowMessage('Welcome');
This message have bad position, without caption,
Also what if i want to make my own dialogs, Have a caption and centered in the Screen.

For example
BorderStyle and WindowState control this idea.

BorderStyle = bsNone/bsSizable
WindowState = wsMaximized
it must make Fit to the screen without caption

BorderStyle = bsDialog
WindowState = wsNormal
is have a caption and OK button

BorderStyle = bsSingle
WindowState = wsNormal
no caption for WinCE and X button

that for example, i know you are already worked on it, but i like to understand what we must choose.

(I am bad writer even in my mother language)

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/3adf02ed/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to denisgolovan: Yes, most applications seem to leave bottom panel visible. See screenshot Sad story :(…

2008/2/18 denisgolovan :

Show quoted text 5 lines
>Some people want the app to do like on other widgetsets: just close. >Then we need an way to detect that. WM_CLOSE doesn't work. And we also >need a mechanism to override that. Yes, it seem that such mechanism is needed. Can I help you something... to make it work?

Sure:

http://wiki.lazarus.freepascal.org/How_To_Help_Developing_Lazarus

http://wiki.lazarus.freepascal.org/Creating_A_Patch

http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes

You need to find a way to implement it, then do it (I can help in this part), then test it, and if you did the implementation send a patch.

Did, as you've said. Really. Nothing changed. In design-time I see my russian chars properly (UTF-8 locale), but on WinCE those symbols (seems WinCE wants cp1251 charset?)

Well, then you probably found a bug on the wince interface. Can you describe it better? What can't be shown as unicode? How do you set this value?

WinCE is a purely unicode OS. If there is a bug somewhere it's in the lazarus wince interface. (or in your code)

Also, I hope you have a very latest wince interface. The unicode fixes are like 1 or 2 days old.

Hm. I didn't catch you. Wince (windows mobile) uses wince widgetset? Why Gtk1 problems appear?

The wince interface wants UTF-8. Now, how can you give it UTF-8 if your IDE is working only in whatever system locale you have? You need an IDE which let's you give UTF-8 to the WinCE interface.

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to denisgolovan: Well, much better now. Thanks. But grid scrollbar is still too low :(. See screenshot…
But grid scrollbar is still too low :(. See screenshot (next time will be a movie :)))) )

Well, I never fixed it (or tryed). I have no idea what the problem could be.

2008/2/18 denisgolovan :

Show quoted text 6 lines
Well, much better now. Thanks. ============================================================================== r14182 | sekelsenmat | 2008-02-18 15:53:41 +0200 (???, 18 ??? 2008) | 1 line Several upgrades for device selection and form position/size on wince. ============================================================================== That's it?

Exactly!

Wrong codepage problem disappeared o_O. You did something? Or maybe full rebuild helped?

After each svn update you need to rebuild LCL, preferably a clean build.

There are several recent revisions fixing unicode. If you find any unicode related bug please report.

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to zaher dirkey: I want to make Message Box, this message not fit to the screens, as like any message in…

Hi, about all the positioning and sizing issues, I tryed recently to fix them, but I wasn't able to fix everything, and now my time for this week (maybe actually next 3 weeks or more, althougth I can always find some spaces) is over.

I documented on the wiki how it should work:

http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes#ApplicationType

http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes#Positioning_and_size_of_Dialogs_and_Forms

It would be great if you take a look at what I did in my partial fixes and if you can take from there and finish fixing this. It's not hard, it just needs someone with time to test it. If you have problems I can answer your questions.

If you don't manage to fix it or doesn't want to try, then open bug reports for the problems and I'll try again to fix them when I have time.

thanks,

Felipe Monteiro de Carvalho

Reply by email

zaher dirkey
to Felipe Monteiro de Carvalho: 2008/2/18 denisgolovan : Sure: http://wiki.lazarus.freepascal.org/How_To_Help_Developing_L…
Show quoted text 5 lines
The wince interface wants UTF-8. Now, how can you give it UTF-8 if your IDE is working only in whatever system locale you have? You need an IDE which let's you give UTF-8 to the WinCE interface.

I have Ansi source code, i make change for WinCE by use AnsiToUtf8 before passing it to draw.
Is that correct?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080218/88670095/attachment.html

Reply by email

Felipe Monteiro de Carvalho
to zaher dirkey

2008/2/18 zaher dirkey :

I have Ansi source code, i make change for WinCE by use AnsiToUtf8 before passing it to draw. Is that correct?

Well, if it works for you, from the point of view of the WinCE interface all that matters is that it receives UTF8 strings (only on subversion! The 0.9.24 release was using ansi encoding, and needs that).

I suppose you are using the windows IDE. You can also make your windows IDE unicode capable by rebuilding it with
-dWindowsUnicodeSupport (only do that if you are using subversion Lazarus!)

http://wiki.lazarus.freepascal.org/LCL_Defines#Win32_defines

Things walk together. WinCE was ansi on 0.9.24 simply because the Win32 Lazarus IDE, the most common tool to write LCL WinCE apps was Ansi.

Now the win32 interface is going to unicode, and therefore WinCE can also go to unicode.

I am very proud of the work done on the win32 unicode support and I am very confident we will have a 0.9.26 unicode release for both Win32 and WinCE.

thanks,

Felipe Monteiro de Carvalho

Reply by email

denisgolovan
Show quoted text 21 lines
Hi, about all the positioning and sizing issues, I tryed recently to fix them, but I wasn't able to fix everything, and now my time for this week (maybe actually next 3 weeks or more, althougth I can always find some spaces) is over. I documented on the wiki how it should work: http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes#ApplicationType http://wiki.lazarus.freepascal.org/Windows_CE_Development_Notes#Positioning_and_size_of_Dialogs_and_Forms It would be great if you take a look at what I did in my partial fixes and if you can take from there and finish fixing this. It's not hard, it just needs someone with time to test it. If you have problems I can answer your questions. If you don't manage to fix it or doesn't want to try, then open bug reports for the problems and I'll try again to fix them when I have time. Felipe Monteiro de Carvalho

Ok. I'll do my best.
Unicode seems working fine.

Regards,
Denis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capture.jpg
Type: image/jpeg
Size: 7567 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080219/ec29de7c/attachment-0001.jpg

Reply by email