Recent

Author Topic: Xi Controls / MessgDls Ported  (Read 4237 times)

wladiz2001

  • New member
  • *
  • Posts: 5
Xi Controls / MessgDls Ported
« on: January 19, 2014, 05:57:04 am »
Greetings

Recently, I have ported the library of components called "Xi Controls" containing XiButton, XiPanel, XiProgressBar And XiTrackBar and messages "MessDlg" as far as I was able to test, they work well. Can anyone confirm this?

And Where can I publish for use by other programmers?

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Xi Controls / MessgDls Ported
« Reply #1 on: January 19, 2014, 08:36:45 am »
I've also done this, using it in my Delphi apps.

Crossplatform is doable, only thing doesn't compile is msdlgs, it uses "LoadIcon" from winapi (Works in linux if remove that (tested 1 year ago), without icons ofcourse)

Maybe Lazarus ccr?

wladiz2001

  • New member
  • *
  • Posts: 5
Re: Xi Controls / MessgDls Ported
« Reply #2 on: January 19, 2014, 04:52:43 pm »
I have reviewed the unit Graphics.pp and LoadIcon is:

function LoadIcon(hInstance: THandle; lpIconName: PChar): HIcon;
var
  Ico: TIcon;
begin
  Ico := TIcon.Create;
  try
    if PtrUInt(lpIconName) > High(Word)
    then Ico.LoadFromResourceName(hInstance, lpIconName)
    else Ico.LoadFromResourceID(hInstance, PtrInt(lpIconName));
    Result := Ico.ReleaseHandle;
  finally
    Ico.Free;
  end;
end;

the function LoadIcon is no longer dependent the Windows API
(the icons are new and included in a res file) ...


Another thing, is there any website where I can post the ported components?, To avoid double work

mica

  • Full Member
  • ***
  • Posts: 192

Timewarp

  • Full Member
  • ***
  • Posts: 144
Re: Xi Controls / MessgDls Ported
« Reply #4 on: February 05, 2014, 05:37:55 pm »
Attached my / combined version. Some bugs were also fixed.

Usage: Just install lazxicontrols package (in Delphi install xicontrols.pas to new package)

When tested in Linux, icons did not show up, don't know why (Loading from resource worked in Windows, when tested)  Resource is not used/needed in Windows.

Btw, loadicon is no longer in graphics, it was moved to LCLIntf.

wladiz2001

  • New member
  • *
  • Posts: 5
Re: Xi Controls / MessgDls Ported
« Reply #5 on: February 17, 2014, 02:12:46 am »
I made some changes, include and convert resources into lazresources and write a LoadLazIcon function, delete all windows (unit references), change to {$mode objfpc} in all units, I think I should work in Linux too

If someone can test it ... thanks

PD. I like the name lazXiControls then I use it for the package
PD. I would like to mantain this controls and others that I'm writing. How I request access to Lazarus ccr?