Recent

Author Topic: KOL-CE - compact applications for WinCE  (Read 117966 times)

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
X-button on WinCE, can it be hidden or changed to ok?
« Reply #45 on: February 18, 2008, 04:03:44 pm »
Hi,

Using KOL-CE, I can no longer set the Borderstyle to bsDialog to make the x-button change into ok and close the application.

Is there a way to achieve this using KOL-CE (or to get rid of the x-button at all?)

John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
RE: X-button on WinCE, can it be hidden or changed to ok?
« Reply #46 on: February 19, 2008, 12:11:07 pm »
ok-button is displayed for modal froms, which are called using ShowModal.

ghostwheel

  • Newbie
  • Posts: 2
RE: X-button on WinCE, can it be hidden or changed to ok?
« Reply #47 on: February 19, 2008, 05:23:01 pm »
I'm using kol-ce to write an app for a wm5 smartphone. It works great! Thank you!!
I had problems with the installation - the usual
---------
Compiling resource KOL-CE.rc
arm-wince-windres.exe: no resources
KOL.PAS(57901) Error: Error while linking
KOL.PAS(57901) Fatal: There were 1 errors compiling module, stopping
----------
errors. After many install-remove cycles, it now finally works. I'm not sure what I did right this time. It could be that It was the following: when opening the environment variables dialog, there are two setting for "path": one for the  user, one for the system (1st called PATH, 2nd one is called Path). I also set the system Path to point to the right place, not only the user PATH.

Anyway - now it works.
I have a question:
As recommended, I use defaultPosition=true, defaultSize=true, so that the form is full screen on the device.
Inside the form I have labels, for which I set AnchorBottom=true. Indeed, when I resize the window, they move with the bottom of the window.
The problem is the original resize. The window is resized to the default size, but the Labels don't move. So they get somewhere random in the window
(not random, really, just not where I want them), and then resize moves them relative to that place.
Is it somehow possible to have the original resize of the TKOLForm also affect widgets?

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
RE: X-button on WinCE, can it be hidden or changed to ok?
« Reply #48 on: February 19, 2008, 07:53:20 pm »
It is known issue.
Put all controls into panel. Do not align panel at design time. Set panel alignment to caClient in OnCreate event of the form.

ghostwheel

  • Newbie
  • Posts: 2
RE: X-button on WinCE, can it be hidden or changed to ok?
« Reply #49 on: February 20, 2008, 05:28:58 pm »
Thank you! That works. (I still have to figure out how to make all the alignments work...)

I have a second question: for my app (a calculator...) I needed to use more math functions, and exceptions. When I put "err" in "uses", I could not compile for winCE, because it seems that the library includes some code in x86 assembly in the exceptions part.
Instead I put "Math" and "SysUtils" as units, and everything seems to work fine. The program compiles to be somewhat larger (140KB - it used to be 50KB once), but it is still much smaller than the original 10MB that it was with LCL....

Should I have used KOL? How?

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
RE: X-button on WinCE, can it be hidden or changed to ok?
« Reply #50 on: February 20, 2008, 05:53:44 pm »
"Err" unit is not ported to fpc yet.
The only solution for now is to use sysutils for exception handling.

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
Re: RE: X-button on WinCE, can it be hidden or changed to ok
« Reply #51 on: February 21, 2008, 07:32:05 pm »
Quote from: "yury_sidorov"
ok-button is displayed for modal froms, which are called using ShowModal.


Right. The reason I asked was because for the average user it is hard to see if a program is still running in the background.

I solved the issue by putting this code in the the project_1.inc file:

Code: [Select]

   hWnd := FindWindow(nil, 'Formname');
   if hWnd <> 0
    then
    begin
     SetForegroundWindow(hWnd);
     halt(0);
    end;
 


and that solves my problem. If the program is restarted, the  first instance is brought to front. Seems to work ok!

ps and thanks for fixing the date-format! :-)

John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
KOL-CE - compact applications for WinCE
« Reply #52 on: February 22, 2008, 11:21:25 am »
It is more reliable to use JustOneActivate function to activate running instance.

Add the following code ProjectName_1.inc file:

Code: [Select]
if JustOneActivate(Form1.Form, 'MyProg') <> 0 then begin
   Form1.Form.Free;
   Halt;
 end;

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
KOL-CE - compact applications for WinCE
« Reply #53 on: February 22, 2008, 12:36:17 pm »
Quote from: "yury_sidorov"
It is more reliable to use JustOneActivate function to activate running instance.

Add the following code ProjectName_1.inc file:

Code: [Select]
if JustOneActivate(Form1.Form, 'MyProg') <> 0 then begin
   Form1.Form.Free;
   Halt;
 end;


?? This gives me an AV when calling JustOneActivate.

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
KOL-CE - compact applications for WinCE
« Reply #54 on: February 25, 2008, 04:39:14 pm »
Did you put this code into ProjectName_1.inc file and replaced Form1 with name of your main form?

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
KOL-CE - compact applications for WinCE
« Reply #55 on: February 26, 2008, 01:20:31 pm »
Quote from: "yury_sidorov"
Did you put this code into ProjectName_1.inc file and replaced Form1 with name of your main form?


Yes I did. It seems I cannot access Form1. If I force the program to stop in any circumstances this way:

Code: [Select]

   if TRUE // JustOneActivate(Form1.Form, 'MyProg') <> 0
     then
      begin
       Form1.Form.Free;
       Halt;
      end;    

the same AV occurs.


If I change the code to:
Code: [Select]

    if JustOneActivate(applet, 'MyProg') <> 0
     then
      begin
       Applet.Free;
       Halt;
      end;


it seems to work ok, but is this the right way?

John

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
TKolPaintbox, how to load/save drawing?
« Reply #56 on: February 27, 2008, 10:24:37 am »
Hi Yury,

In my application I need to give the user the possibility to draw a little picture using the stylus. This works Ok using TKolPaintbox. However, do you have a suggestion as how to load/save the drawing?

thanks in advance!
John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 157
RE: TKolPaintbox, how to load/save drawing?
« Reply #57 on: February 28, 2008, 09:30:37 pm »
You can use Applet for JustOneActivate as well.

You need to paint on bitmap canvas and use paintbox for accepting stylus input and displaying bitmap contents.
bitmap can be loaded/saved using corresponding methids.

oraitecamonyes

  • New Member
  • *
  • Posts: 31
    • http://blog.ptvet.com
KOL-CE - compact applications for WinCE
« Reply #58 on: February 29, 2008, 04:10:53 pm »
Quote from: "yury_sidorov"
Set form's defaultSize and defaultPosition to True.
Turn on "Strp symbols..." option and you should have exe 40-50KB.


hello guys,

cant seem to find the "Strp symbols..." option!
where is it?

OK, fount it! COMPILER OPTIONS -> LINKING -> STRIP SYMBOLS FROM EXECUTABLE (-Xs)

but my EXE is still about 1MB... what am i missing??

ok, found it again :D LOL
i just have to use:
arm-wince-strip.exe  and upx.exe

my app is 33KB now ;)

zybook

  • Newbie
  • Posts: 1
RE: Re: Cannot install
« Reply #59 on: March 01, 2008, 08:29:26 am »
KOL-CE is a good good good develper tool.  

how can it support the WEB Browser component?

 

TinyPortal © 2005-2018