Linux RADGUI Development l Kylix Rapid Application Development

  • Slides: 43
Download presentation
Linux RAD/GUI Development l Kylix – Rapid Application Development (RAD), GUI Development for Linux

Linux RAD/GUI Development l Kylix – Rapid Application Development (RAD), GUI Development for Linux from Borland by Leland Brode ELB Software elbrode 2@attbi. com

Linux GUI Development l Presentation Outline – – – Background on GUI Development Overview

Linux GUI Development l Presentation Outline – – – Background on GUI Development Overview of Kylix Demo GUI Tools Demo Delphi Demo Kylix by Leland Brode ELB Software elbrode 2@attbi. com

Linux GUI Development l Kylix – – – RAD/GUI tool for Linux Port of

Linux GUI Development l Kylix – – – RAD/GUI tool for Linux Port of Delphi for Windows Runs on Linux Builds, compiles native Linux applications Cross platform – Windows/Linux

GUI Dev Background l Windows 3. 0 – 1990 – l Basic, COBOL, C

GUI Dev Background l Windows 3. 0 – 1990 – l Basic, COBOL, C – l Generates Messages All Text Visual Basic – 1991 – – First GUI Dev Tool Event Handlers – code that runs before or after an Event Draw window instead of code it Most widely used language “Visual Basic 6 Bible” - Smith Whistler, & Marquis

GUI Dev Background l Other GUI Dev Tools – – – Power. Builder Visual

GUI Dev Background l Other GUI Dev Tools – – – Power. Builder Visual Age Digitalk, Parc. Place Smalltalk Forte ( now at Sun) Visual C++ Borland Delphi Borland C++Builder -------------Visual Café - Java JBuilder - Java

Linux Developement l GNU Linux Toolkit – – l GCC Compiles C, C++, Objective

Linux Developement l GNU Linux Toolkit – – l GCC Compiles C, C++, Objective C, Fortran Handles Front-ends for Pascal, Modula-3, Ada Distributed with Linux Perl, Shell scripting

Linux Developement l Qt Class Library – – C++ Cross Platform l l l

Linux Developement l Qt Class Library – – C++ Cross Platform l l l – – Qt/Windows Qt/X 11 (Linux, Solaris, HPUX, AIX, etc) Qt/Mac GPL – Free for non-commercial apps Qt was used to build KDE from Trolltech in Norway www. trolltech. com

Linux Development l Qt Class Libray l Qwidget base class – Event Handlers l

Linux Development l Qt Class Libray l Qwidget base class – Event Handlers l l l l l mouse. Press. Event (QMouse. Event &); mouse. Move Event (… mouse. Press. Event (… enter. Event (… Class QMouse. Event : public Qevent { public: int x(); int y(); int button(); int state(); “Linux Programming Unleashed” – Kurt Wall - SAMS

Linux Development l Open Source IDE’s – – – KDevelop – www. kdevelop. org

Linux Development l Open Source IDE’s – – – KDevelop – www. kdevelop. org KDE Studio – www. thekompany. com/projects/kdestudio Code Crusader – www. newplanetsoftware. com VDK Builder – vdkbuilder. sourceforge. net Source-Navigator – sources. redhat. com/sourcenav “C/C++ Users Journal”, March 2001 – www. cuj. com

Delphi Background l Borland’s Delphi = – – Pascal, plus Borland’s implementation of OO

Delphi Background l Borland’s Delphi = – – Pascal, plus Borland’s implementation of OO in Pascal, plus GUI IDE, plus Visual Component Library (VCL) - encapsulates Windows controls

Delphi l Pascal – – – – Pascal dev by Niklas Wirth (Swiss, 1970)

Delphi l Pascal – – – – Pascal dev by Niklas Wirth (Swiss, 1970) Versions: U of C San Diego, Borland’s Turbo Pascal 1. 0 - ? Turbo Pascal 3. 0 for DOS - 1985 Object Extensions to Pascal 5. 5 - ? Turbo Pascal for Windows - 1991 Delphi - OO Pascal – 1995 l polymorphism, inheritance, encapsulation http: //www. engin. umd. umich. edu/CIS/course. des/cis 400/index. html http: //www. emsps. com/oldtools/borpasv. htm

Delphi l GUI Integrated Development Environment – Based on Visual Basic model

Delphi l GUI Integrated Development Environment – Based on Visual Basic model

Delphi l IDE – project manager l – code editor l – – keeps

Delphi l IDE – project manager l – code editor l – – keeps track of all source files for a project code completion GUI form designer integrated debugger l l watch variables change variables breakpoints step through code

Kylix l Port of Delphi to Linux – – OO Pascal Delphi IDE native

Kylix l Port of Delphi to Linux – – OO Pascal Delphi IDE native Linux compiler Class Library - CLX l Object wrappers for Qt widgets – Borland chose Qt over GTK+ l Delphi’s VCL re-engineered to CLX

Kylix l Class Libraries – – – CLX is to Kylix VCL is to

Kylix l Class Libraries – – – CLX is to Kylix VCL is to Delphi, C++Builder MFC is to Visual C++ Qt is to KDE GTK is to GNOME CLX runs on Linux and Windows

Delphi l VCL Class Library – Object wrappers for Windows Controls TObject | TControl

Delphi l VCL Class Library – Object wrappers for Windows Controls TObject | TControl __ | | TForm TButton

Kylix l CLX Class Library – Object wrappers for Qt Widgets TObject | TControl

Kylix l CLX Class Library – Object wrappers for Qt Widgets TObject | TControl __ | | TForm Tbutton – CLX also in Delphi 6, and C++Bldr for cross platform

Kylix l Pascal Language – – Source File = Units -> compile, link ->

Kylix l Pascal Language – – Source File = Units -> compile, link -> executable l l code -. pas file form -. dfm file ( each form has a. pas file )

Kylix l Pascal Language – Data types l l l – Integer – 2147483648

Kylix l Pascal Language – Data types l l l – Integer – 2147483648 to 2147483647 Cardinal 0 to 4, 294, 967, 785 Byte 0 to 255 Double floating point Currency Arrays – l l My. Array : array[0. . 10] of Integer; // fixed My. Array : array of Integer; // dynamic Set. Length(My. Array, length); // allocates memory for dynamic array My. Array[length-1] : = 1, 024 // assignment

Kylix l Pascal Language – String – dynamic l – – Pointers Exceptions l

Kylix l Pascal Language – String – dynamic l – – Pointers Exceptions l – – – Concat, Copy, Delete, Insert, Length, Pos, Set. Length Try-except (same as try-catch in java, c++) File IO function – returns value procedure – no return value

Kylix l Pascal Language - function Factorial(Number : Cardinal): Int 64; var N :

Kylix l Pascal Language - function Factorial(Number : Cardinal): Int 64; var N : Cardinal; begin Result : = 1; for N : = 2 to Number do Result : = Result * N; end;

Kylix l Pascal Language – class definition type TAccount = class private f. Number

Kylix l Pascal Language – class definition type TAccount = class private f. Number : Cardinal; f. Balance : Currency; public procedure With. Draw(Amount : Currency); end; TSavings. Account = class (TAccount) private f. Return. Check : Boolean end; TCertificateof Deposit = class(TSavings. Account) private f. Term : Cardinal; end;

Kylix l Pascal Language – use classes var CD 1, CD 2 : TAccount;

Kylix l Pascal Language – use classes var CD 1, CD 2 : TAccount; begin CD 1 : = TCertificateof. Deposit. Create; CD 2 : = TCertificateof. Deposit. Create; … CD 1. With. Draw(100. 00); … … CD 1. Free; CD 2. Free; end;

Kylix l Pascal Language – Records and Arrays type Person. Type = record Last.

Kylix l Pascal Language – Records and Arrays type Person. Type = record Last. Name : String[10]; First. Name : String[10]; Employee. Number : Integer; end; { Persontype } My. Array. Type = array [1. . 5] of Person. Type; var Person. Array : My. Array. Type; begin Person. Array[1]. First. Name : = ‘Donald’; Person. Array[1]. Last. Name : = ‘Duck’; …

Kylix l Pascal Language – Components and Arrays var Button. Array : array of

Kylix l Pascal Language – Components and Arrays var Button. Array : array of TButton; i, Num : integer; begin Num : =0; for i : = 0 to Self. Component. Count – 1 do // ‘Self’ same as ‘this’ in C++ if Self. Components[i] is TButton then begin Inc(Num); Set. Length(Button. Array, Num); Button. Array[Num-1] : = TButton(Components[i]); end;

Kylix l Pascal Language – Comparison Pascal… var i : Integer; begin i :

Kylix l Pascal Language – Comparison Pascal… var i : Integer; begin i : = 1; C++… int i; i = 1; Perl… my $i; $i = 1;

Kylix l Pascal Language – Comparison Pascal… var i : Integer; name String[20]; begin

Kylix l Pascal Language – Comparison Pascal… var i : Integer; name String[20]; begin if i = 1 then begin name : = ‘Leland’; i : = i + 1; end; C++… int i; char name[20]; if(i == 1) { strcpy(name, “Leland”); i = i + 1; } Perl… my $i; my $name; if($i == 1) { $name = ‘Leland’; $i = $i + 1; }

Kylix l Pascal Language – Comparison Pascal… while i < 100 do Inc(i); C++…

Kylix l Pascal Language – Comparison Pascal… while i < 100 do Inc(i); C++… while (i < 100) i++; Perl… while ($i < 100) { $i++; }

Kylix l Pascal Language – Comparison Pascal… for i : = 0 to 100

Kylix l Pascal Language – Comparison Pascal… for i : = 0 to 100 do begin if i = 50 then Break; end; C++… for( i = 0; i <= 100; i++) if( i == 50) break; Perl… for( $i = 0; $ i <= 100; $i++) { if( $i == 50) last; }

Kylix l Qt – l access to all Qt Widget public Events and Properties

Kylix l Qt – l access to all Qt Widget public Events and Properties Libc – access to all ‘libc’ functions

Kylix l l GUI Applications Database Applications Console Applications Web Server Applications

Kylix l l GUI Applications Database Applications Console Applications Web Server Applications

Kylix l Linux Multiprocessing apps – l separate memory, communicate via file system Linux

Kylix l Linux Multiprocessing apps – l separate memory, communicate via file system Linux Multithreading apps – – same memory, share resources TThread base class

Kylix l GUI Applications - (CLX TForm class) – Form 1. Canvas. Brush. Color

Kylix l GUI Applications - (CLX TForm class) – Form 1. Canvas. Brush. Color : = cl. Red; – – – – – or : = RGB(255, 0, 0); Form 1. Canvas. Rectangle(10, 100, 100); Form 1. Canvas. Pen. color : = cl. Black; Form 1. Canvas. Pen. Width : = 2; Form 1. Canvas. Move. To(0, 20); // draw line Form 1. Canvas. Line. To(60, 20); // draw line Form 1. Canvas. Font. Name : = ‘Arial’; Form 1. Canvas. Font. Size : = 24; Form 1. Canvas. Text. Out(30, 1, ‘Hello World’); // write text

Kylix l Database Applications – – – db : TClient. Data. Set db. File.

Kylix l Database Applications – – – db : TClient. Data. Set db. File. Name : = ‘/xxx/nnn/yyy’; db. Open; db. Locate(‘Emp. Num’, ‘ 124433’, []); mystring : = db. Field. Values[‘Last. Name’];

Kylix l Database Applications – – – db : TSQLData. Set db. Command. Text

Kylix l Database Applications – – – db : TSQLData. Set db. Command. Text : = ‘select * from …. ’; db. Open;

Kylix l Database Applications – – data aware controls automatically fill in data value

Kylix l Database Applications – – data aware controls automatically fill in data value from database automatically update data value to database controls can be ‘Active’ while building form

Kylix l Web Applications - raw CGI or - TWeb. Application | TCGIApplication

Kylix l Web Applications - raw CGI or - TWeb. Application | TCGIApplication

Kylix l Kylix Versions – Kylix 1, 2, 3 (I am using 2) Kylix

Kylix l Kylix Versions – Kylix 1, 2, 3 (I am using 2) Kylix 1, 2 – Delphi (Pascal) Kylix 3 – add C++ Builder (C++) – Kylix Enterprise - Web, Middleware objects, – – Database objects – – Kylix Professional - Database objects Kylix Open Edition – Build open source apps licensed under GNU General Public License

Kylix l Technical Requirements – Kylix 2 – – – Pentium 400 Mhz (

Kylix l Technical Requirements – Kylix 2 – – – Pentium 400 Mhz ( I am using 366 Mhz) 128 MB RAM ( I am using 192 MB) 175 MB disk space Red Hat 6. 2 or higher (I am using 7. 2, Kernel 2. 4. 7) Su. SE 7. 0 or higher

Kylix l Kylix Download – – – http: //www. borland. com/products/download_kylix. html# Kylix 3

Kylix l Kylix Download – – – http: //www. borland. com/products/download_kylix. html# Kylix 3 currently available Kylix 2 ? ?

Kylix l Free. CLX Project • Open Source CLX Class Library • • available

Kylix l Free. CLX Project • Open Source CLX Class Library • • available at Source. Forge. net includes Base. CLX, Visual. CLX, and Data. CLX classes (brings full functionality to Kylix Open Edition ? ) • lack of detailed information on Free. CLX

Kylix l Bibliography • • • “Visual Basic Bible”, Smith, Whistler, & Marquis “Delphi

Kylix l Bibliography • • • “Visual Basic Bible”, Smith, Whistler, & Marquis “Delphi in a Nutshell”, Ray Lischer, O’Reilly “Linux Programming Unleashed”, Kurt Wall, SAMS “Object Pascal Language Guide”, Borland Delphi 3 Documentation “Teach Yourself Delphi in 21 Days”, Osier, Grobman, & Batson, SAMS “Kylix: The Professional Developer’s Guide and Reference”, Jon Shemitz, Apress “Mastering Kylix 2”, Cantu & Barbini, SYBEX “Borland Kylix Developer’s Guide”, Calvert, Kaster, & Swart, SAMS “In the Trenches”, by Dale Fuller, LINUX Magazine, January 2002 Product Review of Kylix 2, LINUX Magazine, May 2002 “Kylix vs. gcc Development” http: //community. borland. com/article/0, 1410, 28555, 00. html “Technical Overview of the Kylix Compiler” http: //community. borland. com/article/0, 1410, 28561, 00. html • • “Apache Development with Kylix” http: //community. borland. com/article/0, 1410, 28556, 00. html Kylix and Qt, excerpts form Kylix newsgroup http: //community. borland. com/article/0, 1410, 21850, 00. html • Kylix newsgroup – “borland. public. kylix, non-technical”

Kylix l product demo…

Kylix l product demo…