Recent

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

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
RE: Re: RE: Re: Sometimes date2Strfmt(
« Reply #90 on: May 02, 2008, 07:06:11 pm »
I published OnEnter and OnLeave for TKolDateTimePicker, but color can not be changed for TKolDateTimePicker for some unknown reason :(

TKOLFrame. It is intended to use in place of TKOLForm, and allows to create and adjust at design time a panel with child controls and objects on a standalone designer form. At run time, instances of such panel together with its children can be put onto another parent control or form dynamically.

ivanf

  • Newbie
  • Posts: 2
Gray area under KOL form - Windows CE 5.0
« Reply #91 on: May 10, 2008, 12:52:44 am »
Hi,

I have been testing KOL components for a few days, looking forward for integrating it to my Windows CE development kit. Amazing job, thanks for it.

However, I have a little problem:  on a Windows CE 5.0 device, I´m getting a grayed area below the form, as you may see in the following image

(http://i26.tinypic.com/2vlw30i.jpg)

If I turn off the "Always on top" property in the taskbar the gray area is hidden (the taskbar area almost fits).

(http://i26.tinypic.com/ngyb8z.jpg)
 
The properties defaulPosition and defaultSize are set to True, according to documentation.
 
I'm guessing that this problem has to do with the fact that in other versions of Windows CE (Windows Mobile 5 on mi iPaq)  another bar exists, where you can choose menu options and showing/hiding keyboard.

Is there a way to get rid of this area?

Thanks in advance

Ivan

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 185
    • http://www.jvdw.nl
Howto attach TKolPopupmenu at runtime?
« Reply #92 on: May 10, 2008, 04:12:13 pm »
Hi Yury,

In the Object Inspector I can attach a popupmenu.

But howto attach a popupmenu to a dynamically created object (at runtime)?

[Edit]
Ok, I found SetAutoPopupMenu and it works. However, if I have connected this popupmenu to several PObjects, how to dermine from which Object the popupmenu was fired?

 "Sender" and "Item" don't tell nothing about the originating object that fired the popup, am I right?

[/Edit]


cheers,
John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
KOL-CE - compact applications for WinCE
« Reply #93 on: May 10, 2008, 04:56:49 pm »
ivanf, this area is menu area and you notice it because you areusing non-standaed app-bar.

To hide menu area insert the following code in OnCreate event of a form:

Code: [Select]
Form.CreateWindow;
DestroyWindow(SHFindMenuBar(Form.Handle));
Form.BoundsRect:=GetWorkArea;
Form.HasBorder:=False;

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
KOL-CE - compact applications for WinCE
« Reply #94 on: May 10, 2008, 05:02:19 pm »
Define for your project USE_MENU_CURCTL and make sure that KOL.pas is recompiling.
Then use CurCtl property of popup menu object.

P.S. Study KOL sources better. All interfaces are well commented. :)

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 185
    • http://www.jvdw.nl
KOL-CE - compact applications for WinCE
« Reply #95 on: May 12, 2008, 06:06:56 pm »
Quote from: "yury_sidorov"
Define for your project USE_MENU_CURCTL and make sure that KOL.pas is recompiling.
Then use CurCtl property of popup menu object.


Right, that works!
Quote

P.S. Study KOL sources better. All interfaces are well commented. :)


Right again! However, its not like "find it in the source" but rather "first read the source" to find out how KOL works... It 's an approach I have to get used to, since it's not the way I used to find help in delphi or lazarus.

But I learn everyday... ;-)

Kind regards,
John

ivanf

  • Newbie
  • Posts: 2
KOL-CE - compact applications for WinCE
« Reply #96 on: May 12, 2008, 09:47:03 pm »
Quote from: "yury_sidorov"
ivanf, this area is menu area and you notice it because you areusing non-standaed app-bar.

To hide menu area insert the following code in OnCreate event of a form:

Code: [Select]
Form.CreateWindow;
DestroyWindow(SHFindMenuBar(Form.Handle));
Form.BoundsRect:=GetWorkArea;
Form.HasBorder:=False;


Thank you very much, it worked like a charm...

Best regards,
Ivan

Chainfire

  • New Member
  • *
  • Posts: 28
Transparent controls
« Reply #97 on: June 10, 2008, 08:17:11 pm »
Yuri,

I seem to be unable to get my controls (panels and labels) to work in transparent mode. I've set Transparent to true, EraseBackground to false and DoubleBuffered to true, to no avail.

Is this not supported on WinCE or am I doing something wrong?

Thanks!

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
RE: Transparent controls
« Reply #98 on: June 11, 2008, 05:00:55 pm »
I did not test transparency on wince. Therefore it is not supported yet...

Chainfire

  • New Member
  • *
  • Posts: 28
Re: RE: Transparent controls
« Reply #99 on: June 11, 2008, 08:33:10 pm »
Quote from: "yury_sidorov"
I did not test transparency on wince. Therefore it is not supported yet...


Ah ok. Too bad. Any plans to test it? (or do I need to make a bounty, or...?)

By the way, another comment:

Code: [Select]

  TOnBitBtnDraw = function( Sender: PControl; BtnState: Integer ): Boolean of object;
  {* Event type for TControl.OnBitBtnDraw event (which is called just before
     drawing the BitBtn). If handler returns True, there are no drawing occure.
     BtnState, passed to a handler, determines current button state and can
     be following: 0 - not pressed, 1 - pressed, 2 - disabled, 3 - focused.
     Value 4 is reserved for highlight state (then mouse is over it), but
     highlighting is provided only if property Flat is set to True (or one
     of events OnMouseEnter / OnMouseLeave is assigned to something). }


Probably related to BITBTN_DISABLEDGLYPH2 define (I did not define this manually, just out-of-the-box KOL), but 1 = disabled and 2 = pressed currently with KOL-CE. May be worthy of an added comment in the source.

(note I am using the 2.80 download from SF from some time ago, not from SVN)

Thanks again for your great work!

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
RE: Re: RE: Transparent controls
« Reply #100 on: June 12, 2008, 02:55:19 pm »
I fixed description of TOnBitBtnDraw handler.

Also I looked at double buffering and transparency code. Unfortunately this code can not be reused for wince due to OS behavior differences :( It is not possible to create general purpose transparency and double buffering support for standard controls in wince like in win32.

You can achieve transparency for your custom needs manually.
Read details here:
http://www.codeproject.com/KB/mobile/transparent_controls.aspx

Chainfire

  • New Member
  • *
  • Posts: 28
RE: Re: RE: Transparent controls
« Reply #101 on: July 21, 2008, 05:26:31 pm »
Yuri,

KOL application do not work right on 320x320 devices. Seems to be an infinite loop to do with SetWindowPos and the handling of the resulting messages, but I was unable to figure it out.

I have made a small test application, you can download at http://www.jongma.org/tmp/320x320-kol.rar. It has the container panel and two subpanels that are aligned bottom and top. I'm not 100% sure if these are required, but changing the alignment in the real application we are building with KOL seemed to move the error from one point in the code to another.

First people reported in about this problem because of the new Treo800w, which has a 320x320 display. I've tried on the Windows Mobile 6 "Square QVGA" emulator and indeed it gives problems. 240x240, 240x320, 480x640, all work fine, just not 320x320.

If you change the application to be resolution aware it does work, but of course then we'd have to modify our complete interface. I hope there is anything you can do to fix this! (We pretty much depend on the 240x320 compatibility mode)

Thanks

Chainfire

  • New Member
  • *
  • Posts: 28
RE: Re: RE: Transparent controls
« Reply #102 on: July 21, 2008, 08:09:56 pm »
Yuri,

After some more investigation, it seems like 240x320 compatibility mode mucks with sizes a bit here and there. As a result (I think)  WM_SIZE gets a slightly different value as response to SetWindowPos calls than was originally used in the SetWindowPos call itself. This creates in infinite loop of calls of SetBoundsRect, which loops back to itself, because:

Code: [Select]

   if RectsEqual( Value, Rect ) then Exit;


in SetBoundsRect is never satisfied.

I've adjusted the RectsEqual function as following:

Code: [Select]

//[FUNCTION RectsEqual]
{$IFDEF ASM_VERSION}
{$ELSE ASM_VERSION} //Pascal
function RectsEqual( const R1, R2: TRect ): Boolean;
begin
//  Result := CompareMem( @R1, @R2, Sizeof( TRect ) );

  Result :=
    (Abs(R1.Top - R2.Top) <= 1) AND
    (Abs(R1.Left - R2.Left) <= 1) AND
    (Abs(R1.Bottom - R2.Bottom) <= 1) AND
    (Abs(R1.Right - R2.Right) <= 1);
end;
{$ENDIF ASM_VERSION}
//[END RectsEqual]


This fixes the issue on the emulator, though it is ofcourse not an elegant solution (I will send it to someone with a Treo800w to see if it fixes the issue there too). Maybe a DEFINE should be used to turn this functionality on and off ?

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 158
RE: Re: RE: Transparent controls
« Reply #103 on: July 22, 2008, 06:45:18 pm »
It should be fixed now. I hope I did not break alignment in some rare cases :)

Chainfire

  • New Member
  • *
  • Posts: 28
Re: RE: Re: RE: Transparent controls
« Reply #104 on: July 23, 2008, 03:55:56 am »
Quote from: "yury_sidorov"
It should be fixed now. I hope I did not break alignment in some rare cases :)


Nice. Could you tell me what you fixed exactly? I hate upgrading files that 'just work' right now ;)

 

TinyPortal © 2005-2018