Difference between revisions of "KOL-CE/ko"

From Lazarus wiki
Jump to navigationJump to search
Line 23: Line 23:
 
또한 가장 최근의 KOL-CE소스를 svn에서 다음 링크를 통해 체크할 수 있다: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk
 
또한 가장 최근의 KOL-CE소스를 svn에서 다음 링크를 통해 체크할 수 있다: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk
  
== Installation ==
+
== 설치 ==
 
----
 
----
'''Important:''' Since KOL-CE 2.80.2 <tt>DisableFakeMethods</tt> define is not needed anymore.
+
'''중요:''' KOL-CE 2.80.2 <tt>DisableFakeMethods</tt> 정의는 더이상 필요치 않기 때문에.
  
If you previously used KOL-CE 2.80.1 or older, you need to rebuild Lazarus '''without''' <tt>DisableFakeMethods</tt> define before installing MCK package. Otherwise '''event handlers will not work'''!
+
만약 KOL-CE 2.80.1 또는 옛 버전을 사용한다면, MCK 패키지를 설치하기 전에 라자루스를 <tt>DisableFakeMethods</tt> 정의 '''없이''' 리빌드 해야한다. 그렇지 않으면 '''이벤트 핸들러는 동작하지 않을 것이다'''!
 +
 
 +
다음과 같이 한다:
 +
# 라자루스 실행.
 +
# '''Tools > Configure "Build Lazarus"...'''메뉴 아이템 선택
 +
# '''Quick Build Options'''페이지 상에서 '''Clean Up + Build all''' 선택
 +
# '''Advanced Build Options'''페이지를 열고 '''Options'''입력 필드에서 <tt>-dDisableFakeMethods</tt>를 '''제거한다''' .
 +
# '''Build'''버튼을 클릭하여 라자루스를 다시 빌드한다.
  
To do that:
 
# Run Lazarus.
 
# Choose '''Tools > Configure "Build Lazarus"...''' menu item.
 
# Choose '''Clean Up + Build all''' on '''Quick Build Options''' page.
 
# Open '''Advanced Build Options''' page and '''remove''' <tt>-dDisableFakeMethods</tt> from '''Options''' input field.
 
# Click '''Build''' button to rebuild Lazarus.
 
 
----
 
----
[[Image:MirrorKOLPackage.png|right|MCK package]]
+
[[Image:MirrorKOLPackage.png|right|MCK 패키지]]
# Download KOL-CE sources and put them on some folder on your filesystem.
+
# KOL-CE 소스를 다운로드하고 파일 시스템상의 임의의 폴더에 저장한다.
# Run Lazarus and choose '''Components > Load package file''' menu item. Then navigate to '''MCK''' folder and choose <tt>'''MirrorKOLPackage.lpk'''</tt> file.
+
# 라자루스를 실행하고 '''Components > Load package file'''메뉴 아이템을 선택한다. 그리고 '''MCK'''폴더를 찾아서 <tt>'''MirrorKOLPackage.lpk'''</tt> 파일을 선택한다.
# Package window will appear. Press '''Install''' button.
+
# 패키지 윈도우가 나타날 것이다. '''Install'''버튼을 누른다.
# Lazarus will compile MCK package and IDE will be restarted.
+
# 라자루스는 MCK패키지를 컴파일하고 IDE는 재시작 할 것이다.
# After restart KOL tab will appear on components palette.
+
# 재시작 후 KOL 탭이 컴포넌트 팔레트에 보일 것이다.
[[Image:KOLComponents.png||KOL components palette]]
+
[[Image:KOLComponents.png||KOL 컴포넌트 팔레트]]
  
NOTE: If you can't see all KOL components on the palette, resize window with components palette vertically. You will see the second row of components on KOL tab (as on screenshot above).
+
주의: 만약 팔레트에 모든 KOL 컴포넌트가 보이지 않는다면, 컴포넌트 팔레트의 윈도우를 수직으로 크기 변경해본다. KOL 탬에 두번째 줄의 컴포넌트가 나타날 것이다.(위의 스크린 샷에 보듯이)
  
MCK package upgrade is very simple as well. Just overwrite KOL-CE sources with new version, open MCK package and press '''Install''' button to recompile the package.
+
MCK 패키지 업그레이드는 매우 쉽다. KOL-CE 소스의 새로운 버전을 겹쳐 쓰기만 하면 된다, MCK 패키지를 열고 '''Install'''버튼을 눌러 패키지를 재 컴파일 한다.
  
 
== Using MCK ==
 
== Using MCK ==

Revision as of 16:23, 9 June 2009

Windows logo - 2012.svg

This article applies to Windows only.

See also: Multiplatform Programming Guide

WinCE Logo.png

This article applies to Windows CE only.

See also: Multiplatform Programming Guide

English (en) français (fr) 한국어 (ko) русский (ru) 中文(中国大陆)‎ (zh_CN) 中文(台灣)‎ (zh_TW)

소개

KOL-CE는 Vladimir Kladov가 개발한 KOL&MCK의 프리 파스칼/라자루스 포트이다(http://kolmck.net). KOL-CE는 Yury Sidorov가 개발하였으며 다음 라이선스하에 배포된다wxWindows Library Licence.

KOL-CE는 매우 컴팩트한 Win32/WinCE GUI 응용프로그램을 생성하게 해준다.(텅 빈 폼을 가진 프로젝트의 실행 파일을 ~40KB 실행파일이 되게 해준다.)

MCK는 라자루스 IDE에서 KOL-CE 프로젝트를 VISUAL 개발 가능하게 해주는 라자루스 패키지이다.

초기에 KOL-CE는 WinCE를 위한 KOL 포트로서만 계획되었다. 그러나 이것은 나중에 Win32 기능을 하고 FPC를 부드럽게 동작하도록 결정되었다.오리지널 KOL은 델파이를 위해 만들어 졌고 FPC와는 잘 동작하지 않았다. 오리지널 MCK는 라자루스와 함께 사용될 수 없었다.

요구사항

  • 프리파스칼 컴파일러 2.2.0 또는 나중의 Win32용
  • arm-wince 크로스 컴파일러 2.2.0 또는 나중의 Win32용([[WinCE port|WinCE] 개발을 위해)
  • 라자루스 0.9.26 또는 나중의 Win32용

지원하는 타겟

  • 모든 32-비트 윈도우즈: 윈도우즈 95에서 Vista까지
  • Windows CE기반 포켓 PC 및 스마트폰

다운로드

최근의 KOL-CE 배포판을 다운로드한다이곳.

또한 가장 최근의 KOL-CE소스를 svn에서 다음 링크를 통해 체크할 수 있다: https://kol-ce.svn.sourceforge.net/svnroot/kol-ce/trunk

설치


중요: KOL-CE 2.80.2 DisableFakeMethods 정의는 더이상 필요치 않기 때문에.

만약 KOL-CE 2.80.1 또는 옛 버전을 사용한다면, MCK 패키지를 설치하기 전에 라자루스를 DisableFakeMethods 정의 없이 리빌드 해야한다. 그렇지 않으면 이벤트 핸들러는 동작하지 않을 것이다!

다음과 같이 한다:

  1. 라자루스 실행.
  2. Tools > Configure "Build Lazarus"...메뉴 아이템 선택
  3. Quick Build Options페이지 상에서 Clean Up + Build all 선택
  4. Advanced Build Options페이지를 열고 Options입력 필드에서 -dDisableFakeMethods제거한다 .
  5. Build버튼을 클릭하여 라자루스를 다시 빌드한다.

MCK 패키지
  1. KOL-CE 소스를 다운로드하고 파일 시스템상의 임의의 폴더에 저장한다.
  2. 라자루스를 실행하고 Components > Load package file메뉴 아이템을 선택한다. 그리고 MCK폴더를 찾아서 MirrorKOLPackage.lpk 파일을 선택한다.
  3. 패키지 윈도우가 나타날 것이다. Install버튼을 누른다.
  4. 라자루스는 MCK패키지를 컴파일하고 IDE는 재시작 할 것이다.
  5. 재시작 후 KOL 탭이 컴포넌트 팔레트에 보일 것이다.

KOL 컴포넌트 팔레트

주의: 만약 팔레트에 모든 KOL 컴포넌트가 보이지 않는다면, 컴포넌트 팔레트의 윈도우를 수직으로 크기 변경해본다. KOL 탬에 두번째 줄의 컴포넌트가 나타날 것이다.(위의 스크린 샷에 보듯이)

MCK 패키지 업그레이드는 매우 쉽다. KOL-CE 소스의 새로운 버전을 겹쳐 쓰기만 하면 된다, MCK 패키지를 열고 Install버튼을 눌러 패키지를 재 컴파일 한다.

Using MCK

Creating MCK project

MCK form
  1. Start Lazarus and select File > New... menu item.
  2. Choose KOL Application under Project section and press OK button.
  3. New project for KOL application will be created.
  4. Save this project with desired name.
  5. Play with your new KOL/MCK Project (adjust parameters, drop TKOL... components, compile, run, debug, etc.) Enjoy!

Adding a form

  1. Select File > New... menu item.
  2. Choose KOL Form under File section and press OK button.
  3. Save new form with desired name.

Writing code

Do not use names from RTL/FCL/LCL, especially from SysUtils, Classes, Forms, etc. All what you need, you should find in KOL, Windows, Messages units. And may be, write by yourself (or copy from another sources). When you write code in mirror project - usually place it in event handlers. You also can add any code where you wish but avoid changing first section of your mirror LCL form class declaration. And do not change auto-generated inc-files. Always remember, that code, that you write in mirror project, must be accepted both by LCL and KOL. By LCL - at the stage of compiling mirror project (and this is necessary, because otherwise converting mirror project to reflected KOL project will not be possible). And by KOL - at the stage of compiling written code in KOL namespace.

IMPORTANT

To resolve conflict between words LCL.Self and KOL.@Self, which are interpreted differently in KOL and LCL, special field is introduced - Form. In LCL, Form property of TKOLForm component "returns" Self, i.e. form object itself. And in KOL, Form: PControl is a field of object, containing resulting form object. Since this, it is correctly to change form's properties in following way:

Form.Caption := 'Hello!'; 

(Though old-style operator Caption := 'Hello!'; is compiled normally while converting mirror project to KOL, it will be wrong in KOL environment). But discussed above word Form is only to access form's properties - not its child controls. You access child controls and form event handlers by usual way. e.g.:

Button1.Caption := 'OK';
Button1Click(Form);

Run-time form creation

It is possible to create several instances of the same form at run-time. And at least, it is possible to make form not AutoCreate, and create it programmatically when needed. Use global function NewForm1 (replacing Form1 with your mirror form name), for instance:

NewForm1( TempForm1, Applet );

To make this possible, NEVER access global variable created in the unit during conversation, unless You know why You are doing so. Refer to Form variable instead.

WinCE

Setup

arm-wince target

You need to install arm-wince cross compiler for Win32 to compile WinCE executables. Get it here.

To compiler for arm-wince target open compiler options of your project using Project > Compiler options... menu item. Open Code tab and change target platform to arm-wince.

NOTE: You can receive the following error while compiling your KOL-CE project for WinCE:

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

In such case you need to edit Windows PATH environment variable and add path to folder where win32 fpc binaries are located.
To find out which path to add, go to Environment options in Lazarus and see compiler path.
Quit Lazarus before editing PATH.
To edit PATH variable right click on My Computer icon go to Advanced tab and click Environment Variables button.

Hints and notes

  • To make form fullscreen as most Pocket PC applications have, don't change the form position and size. If form size and/or position was changed the form will look like dialog with caption and close button. In MCK set defaultSize and defaultPosition of TKOLForm to True to make form fullscreen.

Known issues

  • The following components are not supported: RichEdit.
  • Transparency and double buffering are not supported.
  • Only gsVertical, gsHorizontal gradient panel styles are supported.
  • Horizontal text alignment does not work in single line edit control. Use memo if you need text alignment.
  • Vertical text alignment does not work for panel and label.

Documentation

  • Visit official KOL&MCK website for documentation and information: http://kolmck.net
  • Read MCK documentation in KOLmirrorReadme.txt file inside MCK folder.

KOL-CE in real-world applications

See also

Contacts

Report bugs, submit patches and ask questions at project's page at SourceForge: http://sourceforge.net/projects/kol-ce/