Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-18 Thread Paul Breneman

Jonas Maebe wrote:


On 18 Mar 2010, at 16:24, Paul Breneman wrote:

For the benefit of others reading this message thread I would like to 
mention that I have posted a minimal FreePascal and fpGUI distribution 
for cross-compiling WinCE applications near the bottom of this page:

 http://www.turbocontrol.com/helloworld.htm
That is the starter compiler setup that Graeme is referring to.


As has been suggested a couple times already, it's probably a good idea 
to continue this discussion on the fpGUI newsgroup/forum 
(http://opensoft.homeip.net/fpgui/#Newsgroups).


Thanks,


Jonas
FPC mailing lists admin


Yes, sure.  But there are 3 other minimal FreePascal distributions on 
that page that are just FreePascal and have nothing to do with fpGUI.  :)

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-18 Thread Jonas Maebe


On 18 Mar 2010, at 16:24, Paul Breneman wrote:

For the benefit of others reading this message thread I would like  
to mention that I have posted a minimal FreePascal and fpGUI  
distribution for cross-compiling WinCE applications near the bottom  
of this page:

 http://www.turbocontrol.com/helloworld.htm
That is the starter compiler setup that Graeme is referring to.


As has been suggested a couple times already, it's probably a good  
idea to continue this discussion on the fpGUI newsgroup/forum (http://opensoft.homeip.net/fpgui/#Newsgroups 
).


Thanks,


Jonas
FPC mailing lists admin
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-18 Thread Paul Breneman

Graeme,


Good news, the fixes seem to work well on my Garmin. I fixed some memory
leaks and drawing improvements for the "examples/corelib/helloworld/"
demo too. I'll commit the code tomorrow - I ran out of time today.

@Paul
Thanks again for your FPC+fpGUI starter compiler setup - it makes
testing WinCE so much easier!  :-)


Thanks for the feedback.  I'll try to update that distribution in the 
next couple of days with the latest code.


For the benefit of others reading this message thread I would like to 
mention that I have posted a minimal FreePascal and fpGUI distribution 
for cross-compiling WinCE applications near the bottom of this page:

  http://www.turbocontrol.com/helloworld.htm
That is the starter compiler setup that Graeme is referring to.

--
Regards,
Paul Breneman
www.dbReplication.com - VCL database replication components
www.TurboControl.com - Hardware and software development services
- Educational programming project for environment monitoring
- Information on using FreePascal for embedded systems
- Support information for the TurboPower open source libraries
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-18 Thread Graeme Geldenhuys
Hi,

> yes please,  and if it works please fix the code on git. I will also
> > look at the issue with frames around labels etc
> >

Good news, the fixes seem to work well on my Garmin. I fixed some memory
leaks and drawing improvements for the "examples/corelib/helloworld/"
demo too. I'll commit the code tomorrow - I ran out of time today.

@Paul
Thanks again for your FPC+fpGUI starter compiler setup - it makes
testing WinCE so much easier!  :-)


> > I have read, that you mentioned to think about AggPas as a target for
> > fpGUI.  For me it would be very interesting to combine both (I fixed
> >

Yes, AggPas has some amazing graphics features. I hope the fpGUI+AggPas
integration works well, then maybe I can replace all painting in all
backends to rather use AggPas, and let each backend simply handle
windowing and system events. This will greatly reduce the effort to
support even more backends/platforms.

> > ks - ok. I am dreaming now  ;-) .
> >

That's how every programming project starts.  :-)


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-17 Thread Adrian Veith
Am 16.03.2010 16:11, schrieb Graeme Geldenhuys:
> On 16 March 2010 15:03, Adrian Veith  wrote:
>   
 
>> Now my second solution works:
>> 
>
> Thank you very much. I'll take a look at the code and test on my
> Garmin in the next day or two.
>   

yes please,  and if it works please fix the code on git. I will also
look at the issue with frames around labels etc

I have read, that you mentioned to think about AggPas as a target for
fpGUI.  For me it would be very interesting to combine both (I fixed
already the code of AggPas to compile for ARM, but there is a problem,
that the demo applications don't start - I guess its a missing system
call).

I would like to have a small widget set (pure pascal, so that it can be
easy ported to all the platforms fpc can target) with very mighty
drawing capabilities, which can be styled like HTML and CSS.

For example: why do we need widgets like Panel and Button and Bitmap
Button (if I look at my Delphi installation, which is still my main
developing environment - I have about 50 different Button widgets and
about 20 Panels). In fact all are rectangular areas which are drawn with
different styles and borders, some are transparent, some contain images,
some are for toolbars, some can contain styled text. If I look at HTML
you have a  with different styles and depending if you have events
attached to it or not, it behaves like a button or a panel. That kind of
simplicity and flexibility is what I want - separate code from layout
and design, but with mighty design possibilities.

That's why I look at fpGUI. fpGUI has very straight forward design and
is easy to change and runs on all platforms. If we bring the amazing
drawing capabilities of AggPas to fpGUI and have a (to be written) style
engine a la CSS - et voila we could have a little gemstone, which is far
beyond existing frameworks - ok. I am dreaming now ;-).

Adrian.






___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-17 Thread Adrian Veith
Paul,

yes I agree with you, that fpGUI is very nice for embedded GUI systems -
and I think it has potential for more. The next thing I will look at, is
why it draws a frame around labels etc. in WinCE - do you have the same
issue ? Should be a minor problem.

Adrian.

Am 16.03.2010 17:59, schrieb Paul Breneman:
> Adrian,
>
> Thank you *very* much for getting fpGUI working better on WinCE.  A
> few months ago I spent quite a bit of time doing the initial work but
> as you've seen in the comments I only had a Motorola Symbol MC1000
> barcode scanner to work with and that just has a 240x240 monochrome
> display.
>
> I hope to get a better WinCE system like this to use with fpGUI:
>   http://www.cubloc.com/product/06_02.php
>
> I've been using fpGUI on this 7" Linux touchscreen:
> http://www.embeddedarm.com/products/board-detail.php?product=TS-TPC-7390
>
> If fpGUI gets DirectFB support that should help on the low-powered
> Linux systems.
>
> When I did all my work a few months ago I hoped someone else would
> come along to take it further so I am *very* pleased to see your
> messages today.  It appears it is going to get even easier to show how
> FreePascal and fpGUI provide simple entry to embedded GUI systems.  :)
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Paul Breneman

Adrian,

Thank you *very* much for getting fpGUI working better on WinCE.  A few 
months ago I spent quite a bit of time doing the initial work but as 
you've seen in the comments I only had a Motorola Symbol MC1000 barcode 
scanner to work with and that just has a 240x240 monochrome display.


I hope to get a better WinCE system like this to use with fpGUI:
  http://www.cubloc.com/product/06_02.php

I've been using fpGUI on this 7" Linux touchscreen:
http://www.embeddedarm.com/products/board-detail.php?product=TS-TPC-7390

If fpGUI gets DirectFB support that should help on the low-powered Linux 
systems.


When I did all my work a few months ago I hoped someone else would come 
along to take it further so I am *very* pleased to see your messages 
today.  It appears it is going to get even easier to show how FreePascal 
and fpGUI provide simple entry to embedded GUI systems.  :)


--
Regards,
Paul Breneman
www.dbReplication.com - VCL database replication components
www.TurboControl.com - Hardware and software development services
- Educational programming project for environment monitoring
- Information on using FreePascal for embedded systems
- Support information for the TurboPower open source libraries
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Graeme Geldenhuys
On 16 March 2010 15:03, Adrian Veith  wrote:
>>>
> Now my second solution works:


Thank you very much. I'll take a look at the code and test on my
Garmin in the next day or two.

-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Graeme Geldenhuys
On 16 March 2010 11:16, Adrian Veith  wrote:
>
> Ok - I got another issue with reading and painting bitmaps. The original
> code throws an error when reading a bitmap file in ReadImage_BMP for 32
> bit depths images.

A known problem. I suspect a endian issue.  I am currently working on
changing the existing BMP read unit with the units included in FPImage
(part of FCL). This will improve BMP image loading and support other
file formats too. The existing BMP unit in fpGUI is a bit limited and
only reads 24bit R8 G8 B8 images.


> BTW. is there another place to discuss fpGUI related problems ?

Yes, please direct future conversations regarding fpGUI to the fpGUI
newsgroups. There is a web interface for the newsgroups too, if you
don't have a news client available.

  http://opensoft.homeip.net/fpgui/#Newsgroups



-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 13:17, schrieb Adrian Veith:
> Am 16.03.2010 11:22, schrieb Adrian Veith:
>   
>> Am 16.03.2010 10:45, schrieb Matt Emson:
>>   
>> 
>>> Adrian Veith wrote:
>>> 
>>>   
 ..the bitmaps look scrambled and have different colors.
 I haven't found the solution for this yet.
   
 
>>> Ignore that last message. It seems WinCE is only ever little endian.
>>> So it is probably more to do with DIB vs general device dependent
>>> Bitmaps. Have you tried converting the bitmap in question to a DIB?
>>>
>>> 
>>>   
>> I am so far that I found that the procedure SetDIBits is not supported
>> on WinCE (that's why it is commented out in the WinCE build). So the
>> Bitmap is not initialized with the data loaded from the file and shows
>> random crap.
>>
>> I have to find  way how to initialize the bitmap without SetDIBits (and
>> in a efficient way).
>>
>> 
Now my second solution works:

{$IFDEF wince}
procedure WinCESetDibBits(BMP: HBITMAP; awidth, aheight: Integer;
aimgdata: Pointer; var bi: TBitmapInfo);
var
  hdcSrc, hdcDest: HDC;
  hbmSrc: HBITMAP;
  bm: BITMAP;
begin
  hdcDest:= CreateCompatibleDC(0);
  SelectObject(hdcDest, BMP);
  if bi.bmiHeader.biBitCount = 1 then begin
SetDIBitsToDevice(hdcDest, 0, 0, awidth, aheight, 0, 0, 0, aheight,
aimgdata, bi, DIB_RGB_COLORS);
  end else begin
hdcSrc:= CreateCompatibleDC(0);
hbmSrc:= CreateBitmap(awidth, aheight, 1, bi.bmiHeader.biBitCount,
aimgdata);
SelectObject(hdcSrc, hbmSrc);
BitBlt(hdcDest, 0, 0, awidth, aheight, hdcSrc, 0, 0, SRCCOPY);
DeleteDC(hdcSrc);
DeleteObject(hbmSrc);
  end;
  DeleteDC(hdcDest);
end;

{$ENDIF}

and the change for TfpgGDIImage.DoInitImage:

  {$IFNDEF wince}
  SetDIBits(wapplication.display, FBMPHandle, 0, aheight, aimgdata, bi,
DIB_RGB_COLORS);
  {$else}
  WinCESetDibBits(FBMPHandle, awidth, aheight, aimgdata, bi);
  {$ENDIF}


and for TfpgGDIImage.DoInitImageMask

  {$IFNDEF wince}
  SetDIBits(wapplication.display, FMaskHandle, 0, aheight, aimgdata,
pbi^, DIB_RGB_COLORS);
  {$ELSE}
  WinCESetDibBits(FMaskHandle, awidth, aheight, aimgdata, pbi^);
  {$ENDIF}

with the patch for loading 32bit bitmaps posted before you can call
fpgCreateStandardImages; in fpg_main:

  {--$IFNDEF wince}
  fpgCreateStandardImages;
  (*  causes EBusError on Symbol MC1000 WinCE 4.2
  see: http://wiki.freepascal.org/Windows_CE_Development_Notes
  "Using ARM processors, some times you may get a EBusError exception with
  a message about misaligned data access.  The following section explains
  what this is and how to fix it." - fixed
  *)
  {--$ENDIF}

cheers Adrian.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 11:22, schrieb Adrian Veith:
> Am 16.03.2010 10:45, schrieb Matt Emson:
>   
>> Adrian Veith wrote:
>> 
>>> ..the bitmaps look scrambled and have different colors.
>>> I haven't found the solution for this yet.
>>>   
>> Ignore that last message. It seems WinCE is only ever little endian.
>> So it is probably more to do with DIB vs general device dependent
>> Bitmaps. Have you tried converting the bitmap in question to a DIB?
>>
>> 
> I am so far that I found that the procedure SetDIBits is not supported
> on WinCE (that's why it is commented out in the WinCE build). So the
> Bitmap is not initialized with the data loaded from the file and shows
> random crap.
>
> I have to find  way how to initialize the bitmap without SetDIBits (and
> in a efficient way).
>
>   

My solution for the moment is:

{$IFDEF wince}
procedure WinCESetInitBMP(BMP: HBITMAP; awidth, aheight, depth: Integer;
aimgdata: Pointer);
var
  hdcSrc, hdcDest: HDC;
  hbmSrc: HBITMAP;
  bm: BITMAP;
  data, p, pend: pByte;
begin
  hdcSrc:= CreateCompatibleDC(0);
  hdcDest:= CreateCompatibleDC(0);
  hbmSrc:= CreateBitmap(awidth, aheight, 1, depth, nil);
  if depth = 32 then
SetBitmapBits(hbmSrc, (awidth * aheight) *4, aimgdata)
  else
SetBitmapBits(hbmSrc, (awidth * aheight) div 8, aimgdata);
  SelectObject(hdcSrc, hbmSrc);
  SelectObject(hdcDest, BMP);
  BitBlt(hdcDest, 0, 0, awidth, aheight, hdcSrc, 0, 0, SRCCOPY);
  DeleteDC(hdcSrc);
  DeleteDC(hdcDest);
  DeleteObject(hbmSrc);
end;
{$ENDIF}


and change the code in TfpgGDIImage.DoInitImage to

  {$IFNDEF wince}
  SetDIBits(wapplication.display, FBMPHandle, 0, aheight, aimgdata, bi,
DIB_RGB_COLORS);
  {$else}
  WinCESetInitBMP(FBMPHandle, awidth, aheight, bi.bmiHeader.biBitCount,
aimgdata);
  {$ENDIF}

and in TfpgGDIImage.DoInitImageMask to:

  {$IFNDEF wince}
  SetDIBits(wapplication.display, FMaskHandle, 0, aheight, aimgdata,
pbi^, DIB_RGB_COLORS);
  {$ELSE}
  WinCESetInitBMP(FMaskHandle, awidth, aheight, bi.bmiHeader.biBitCount,
aimgdata);
  {$ENDIF}

now bitmaps are loaded an painted correctly, but still the stdimg.xxx
(e.g. stdimg.close) are not painted correctly 
- I guess there is a problem with the masking.

Adrian.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 16.03.2010 10:45, schrieb Matt Emson:
> Adrian Veith wrote:
>> ..the bitmaps look scrambled and have different colors.
>> I haven't found the solution for this yet.
> Ignore that last message. It seems WinCE is only ever little endian.
> So it is probably more to do with DIB vs general device dependent
> Bitmaps. Have you tried converting the bitmap in question to a DIB?
>

I am so far that I found that the procedure SetDIBits is not supported
on WinCE (that's why it is commented out in the WinCE build). So the
Bitmap is not initialized with the data loaded from the file and shows
random crap.

I have to find  way how to initialize the bitmap without SetDIBits (and
in a efficient way).

Adrian.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Matt Emson

Adrian Veith wrote:

..the bitmaps look scrambled and have different colors.
I haven't found the solution for this yet.
Ignore that last message. It seems WinCE is only ever little endian. So 
it is probably more to do with DIB vs general device dependent Bitmaps. 
Have you tried converting the bitmap in question to a DIB?


M




___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Matt Emson

Adrian Veith wrote:

  //pcol^ := Plongword(p)^; -- changed
  pcol^ := (LongWord(p[3]) shl 24) + (LongWord(p[2]) shl 16) +
(LongWord(p[1]) shl 8) + LongWord(p[0]);
This looks like an endian issue. Aren't Bitmaps in Little Endian format 
(as per the usual endianess of the Intel x86 processor) and ARM can be 
either in big or little endian? This could explain the scrambling of 
this image too. Are there any routines in the RTL that could be used to 
get round this?


M
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-16 Thread Adrian Veith
Am 15.03.2010 16:20, schrieb Graeme Geldenhuys:
>
> WinCE is experimental, so expect some issue. But that is no excuse. ;-)  I
> can duplicate the slow down on my Garmin iQue M5, so will try and resolve
> the issue before the final v0.7 release. Thanks for bringing this to my
> attention.
>   

Ok - I got another issue with reading and painting bitmaps. The original
code throws an error when reading a bitmap file in ReadImage_BMP for 32
bit depths images.

I change the code in the loop:

while (p) < (pdata) do
begin
  //pcol^ := Plongword(p)^; -- changed
  pcol^ := (LongWord(p[3]) shl 24) + (LongWord(p[2]) shl 16) +
(LongWord(p[1]) shl 8) + LongWord(p[0]);
  //Writeln('color: ',HexStr(pcol^,8));
  Inc(pcol);
  //Inc(Plongword(p)); -- changed
  inc(p, 4);
  Inc(pixelcnt);
end;

this reads the bitmap so far, but there is still a problem with painting
bitmaps in WinCE. It seems, that memory layout is different or something
like that, because the bitmaps look scrambled and have different colors.
I haven't found the solution for this yet.

BTW. is there another place to discuss fpGUI related problems ?

cheers,

Adrian.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-15 Thread Paul Breneman

Hi Adrian,


Hi, this is the first time I looked at fpGUI. Very nice work !

I tried to cross compile some examples for WinCE and it worked so far -
looks like my search is over and I found a nice little GUI framework for
that platform. I was not satisfied with LCL (much too big), KOL (too
weird) and I even thought of switching to c++ and QT, but QT apps take
ages to load on a phone.

One thing I found is, that when a fpGUI application is running on my
WinCE phone (even when it is in the background), the phone will slow
down dramatically. I guess there is an event loop which is too busy -
any idea ?


I'm also using fpGUI for WinCE (and Linux) and I'm excited to see fpGUI 
continue moving forward.


You probably don't need it but I would like to point out for the benefit 
of others reading this message thread that I have posted a minimal 
FreePasacal and fpGUI distribution for cross-compiling WinCE 
applications near the bottom of this page:

  http://www.turbocontrol.com/helloworld.htm

--
Regards,
Paul Breneman
www.dbReplication.com - VCL database replication components
www.TurboControl.com - Hardware and software development services
- Educational programming project for environment monitoring
- Information on using FreePascal for embedded systems
- Support information for the TurboPower open source libraries
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI Toolkit on WinCE

2010-03-15 Thread Graeme Geldenhuys
Adrian Veith het geskryf:
> 
> One thing I found is, that when a fpGUI application is running on my
> WinCE phone (even when it is in the background), the phone will slow
> down dramatically. I guess there is an event loop which is too busy -
> any idea ?

WinCE is experimental, so expect some issue. But that is no excuse. ;-)  I
can duplicate the slow down on my Garmin iQue M5, so will try and resolve
the issue before the final v0.7 release. Thanks for bringing this to my
attention.



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] fpGUI Toolkit on WinCE

2010-03-15 Thread Adrian Veith
Am 09.03.2010 14:16, schrieb Graeme Geldenhuys:
> fpGUI v0.7-rc1 is available
> ---
>   
Hi, this is the first time I looked at fpGUI. Very nice work !

I tried to cross compile some examples for WinCE and it worked so far -
looks like my search is over and I found a nice little GUI framework for
that platform. I was not satisfied with LCL (much too big), KOL (too
weird) and I even thought of switching to c++ and QT, but QT apps take
ages to load on a phone.

One thing I found is, that when a fpGUI application is running on my
WinCE phone (even when it is in the background), the phone will slow
down dramatically. I guess there is an event loop which is too busy -
any idea ?

cheers, Adrian.



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal