Beruflich Dokumente
Kultur Dokumente
L A Z A R U S,
O X Y G E N E,
S M A R T,
A N D
P A S C AL
R E L A T E D
L A N G U A G E S
A N D R O I D,
I O S,
M A C,
W I N D O W S
&
L I N U X
33
6
E
X Y
I
L
H
P
P IM NG
L
DE S S AZI
I M
A
Appmethod
Google Glass
BLAISE
BLAISE PASCAL
PASCAL MAGAZINE
MAGAZINE
D E L P H I, L A Z A R U S, O X Y G E N E, S M A R T, A N D P A S C A L R E L A T E D
L A N G U A G E S F O R A N D R O I D, I O S, M A C,
W I N D O W S & L I N U X
CONTENTS
Article overview
Interview with
Professor Dr.Wirth
PAGE 43
2014 Tour
DC/Baltimore
Chicago
Frankfurt
Amsterdam
London
Bob Swart
&
Cary Jensen
May 5-6
May 8-9
May26-27
June 12-13
June 18-19
Delphi
Developer Days
maXbox Starter 5
maXbox
Programming
Truth Table reduction
By David Dirkse
PAGE 46
COMPONENTS
DEVELOPERS
Components 4 Developers
By Fikret Hasovitch PAGE 65
Articles
maXbox Starter 5 Start with DLL A Library for All By Max Kleiner Page 5
Suite Rays components By Rik Smit Page 14
Interview with Pofessor Dr. Niklaus Wirth By Max Kleiner Page 26
Steps in MindScape AppView Step-By-Step By Jeroen Pluimers Page 26
COMPONENTS
DEVELOPERS
Alexander Alexeev
alexander@blaisepascal.ru
Peter Bijlsma
peter.bijlsma@hcc-pgg.nl
Marco Cant
marco.cantu@gmail.com
David Dirkse
David@davdata.nl
Daniele Teti
d.teti@bittime.it
Bruno Fierens
bruno.fierens@tmssoftware.com
Primo Gabrijeli
primoz@gabrijelcic.org
Fikret Hasovic
fhasovic@yahoo.com
Cary Jensen
cary@jensendatasystems.com
Wagner R. Landgraf
Sergey Lyubeznyy
slyubez@mail.ru
Kim Madsen
kbm@components4developers.com
Mattias Gaertner
nc-gaertnma@netcologne.de
Jeremy North
jeremy.north@gmail.com
Tim Opsteeg
Detlef Overbeek
editor@blaisepascal.eu
Jeroen Pluimers
jeroen@pluimers.com
Rik Smit
rik.smit@hccnet.nl
Bob Swart
Bob@eBob42.com
Authors
A
B
C
D
F
G
H
J
L
K
M
N
O
P
S
Alexander Alexeev
Peter Bijlsma,
Michal Van Canneyt, Marco Cant,
David Dirkse, Daniele Teti
Bruno Fierens
Primo Gabrijeli,
Fikret Hasovic
Cary Jensen
Wagner R. Landgraf, Sergey Lyubeznyy
Max Kleiner
Kim Madsen, Felipe Monteiro de Cavalho
Jeremy North,
Tim Opsteeg, Inoussa Ouedraogo
Howard Page-Clark, Jeroen Pluimers
Rik Smit, Bob Swart,
Advertisers
Barnsten
BetterOffice
Components 4 Developers
Delphi Developer days
Fastreport
Raize Software
Pascon
Smart Mobile Studio
Pag
Page
Page
Page
Page
Page
Page
Page
45
13/52
68
34/64
4
22
2
23
Editor - in - chief
Detlef D. Overbeek, Netherlands Tel.: +31 (0)30 890.66.44 / Mobile: +31 (0)6 21.23.62.68
News and Press Releases email only to editor@blaisepascal.eu
Editors
Peter Bijlsma, W. (Wim) van Ingen Schenau, Rik Smit,
Correctors
Howard Page-Clark, James D. Duff
Trademarks
All trademarks used are acknowledged as the property of their respective owners.
Caveat Whilst we endeavour to ensure that what is published in the magazine is correct, we cannot accept responsibility for any errors or omissions.
If you notice something which may be incorrect, please contact the Editor and we will publish a correction where relevant.
Subscriptions ( 2013 prices )
1: Printed version: subscription 60.-- Incl. VAT 6 % (including code, programs and printed magazine,
6 issues per year excluding postage).
2: Electronic - non printed subscription 45.-- Incl. VAT 21%
(including code, programs and download magazine)
Subscriptions can be taken out online at www.blaisepascal.eu or by written order, or by sending an email to office@blaisepascal.eu
Subscriptions can start at any date. All issues published in the calendar year of the subscription will be sent as well.
Subscriptions run 365 days. Subscriptions will not be prolonged without notice. Receipt of payment will be sent by email.
Subscriptions can be paid by sending the payment to:
ABN AMRO Bank Account no. 44 19 60 863 or by credit card: Paypal
Name: Pro Pascal Foundation-Foundation for Supporting the Pascal Programming Language (Stichting Ondersteuning Programeertaal Pascal)
IBAN: NL82 ABNA 0441960863 BIC ABNANL2A VAT no.: 81 42 54 147 (Stichting Programmeertaal Pascal)
Subscription department Edelstenenbaan 21 / 3402 XA IJsselstein, The Netherlands / Tel.: + 31 (0) 30 890.66.44 / Mobile: + 31 (0) 6 21.23.62.68
office@blaisepascal.eu
Copyright notice
All material published in Blaise Pascal is copyright SOPP Stichting Ondersteuning Programeertaal Pascal unless otherwise noted and may
not be copied, distributed or republished without written permission. Authors agree that code associated with their articles will be made
available to subscribers after publication by placing it on the website of the PGG for download, and that articles and code will be placed on
distributable data storage media. Use of program listings by subscribers for research and study purposes is allowed, but not for commercial
purposes. Commercial use of program listings and code is prohibited without the written permission of the author.
COMPONENTS
DEVELOPERS
COMPONENTS
DEVELOPERS
maXbox
maXbox Starter 28
starter
maXbox
expert
And you get back the process handle like: > 904
With our DLL that just copied and pasted from the script
folder, we will use a next example to retrieve version
information. Until this call here some more topics.
Writeln('Process Handle:'+intToStr(ProcessHandle));
This as an overview:
We started with OpenProcess from kernel32.dll
COMPONENTS
DEVELOPERS
expert
By Rik Smit
Ive chosen for Delphi XE4, but you can also make
combinations of various different versions.
After the last ok everything goes automatically. When
Delphi is then started, youll see that the components are
loaded during start-up (Figure 2) and eventually youll find
them at the bottom part of the Component Palette (Figure
3). So everything is done for you. Because its rather
laborious to get this group on top of the Palette (if you
prefer that) Raize supplied a program that does this job for
you. Run it and youre done!.
14
COMPONENTS
DEVELOPERS
COMPONENTS
DEVELOPERS
21
2.01
The license is now
free for students!
Smart Mobile Studio now offers a free educational licence for students in
school or university or who are members of an after-school coding club.
22
20
30
Nr 4
1 / 2013
2014 BLAISE PASCAL MAGAZINE
www.SmartMobileStudio.com
DEVELOPERS 4
COMPONENTS
expert
type
TW3HeaderControl = Class(TW3CustomControl)
private
FLabel:
TW3Label;
FBackBtn:
TW3ToolButton;
FNextBtn:
TW3ToolButton;
Protected
Resize;Override;
Procedure
protected
InitializeObject;override;
Procedure
FinalizeObject;override;
Procedure
StyleTagObject;override;
Procedure
End;
Procedure TW3HeaderControl.FinalizeObject;
Begin
FLabel.free;
if assigned(FBackBtn) then FBackBtn.free;
if assigned(FNextBtn) then FNextBtn.free;
inherited;
end
The second type, which is the one 90% of all the standard
controls that ship with Smart Mobile Studio derive from, is
TW3CustomControl. So lets have a look at how setting up
a fancy iPhone header looks like:
Procedure TW3HeaderControl.StyleTagObject;
Begin
inherited StyleTagObject;
end;;
24
TW3HeaderControl = Class(TW3CustomControl)
private
FLabel:
TW3Label;
FBackBtn:
TW3ToolButton;
FNextBtn:
TW3ToolButton;
procedure
ReleaseButtons;
Procedure
NeedBackButton;
Procedure
NeedNextButton;
function
getBackButton:TW3ToolButton;
function
getNextButton:TW3ToolButton;
Protected
Procedure
Resize;Override;
protected
Procedure
InitializeObject;override;
Procedure
FinalizeObject;override;
Procedure
StyleTagObject;override;
public
Property
BackButton:TW3ToolButton read
getBackButton;
Property
NextButton:TW3ToolButton read
getNextButton;
property
Title:TW3Label read FLabel;
Property
Options:TW3HeaderButtonOptions
read FOptions write setOptions;
End;
25
By Jeroen Pluimers
expert
function TAppViewModel.GetCanMultiplyCountBy2():
Boolean;
begin
Result := (Count * 2 <= MaximumCount)
and (Count * 2 >= MinimumCount);
end;
procedure TAppViewModel.IncrementCountBy2();
begin
if not CanIncrementCountBy2 then
raise EInvalidOperation.Create(
'not CanIncrementCountBy2');
Count := Count + 2;
end;
procedure TAppViewModel.MultiplyCountBy2();
begin
if not CanMultiplyCountBy2 then
raise EInvalidOperation.Create(
'not CanMultiplyCountBy2');
Count := Count * 2;
end
Add these methods (the first two are strict protected, the final
two public; in my book all methods are virtual):
begin
Result := Count + 1 < MaximumCount;
end;
26
COMPONENTS
DEVELOPERS
35
COMPONENTS
DEVELOPERS
COMPONENTS
DEVELOPERS
29
30
COMPONENTS
DEVELOPERS
http://www.barnsten.com/
Or call: +31 (0)23 542 22 27
Nr 1 . 2014 BLAISE PASCAL MAGAZINE
43
http://www.barnsten.com/
Or call: +31 (0)23 542 22 27
http://www.barnsten.com/
Or call: +31 (0)23 542 22 27
expert
Introduction
Boolean algebra is a kind of algebra that is used in the
design of digital circuits. Also it is of help in programs as
search engines and logic in general. Boolean algebra is
a numeric approach of proposition logic.
There are similarities with set theory.
Boolean algebra was invented by the British
mathematician George Boole (1815 - 1864).
This article describes how my program Logic10 reduces
truth tables by using the rules of Boolean algebra.
A
0
1
0
1
The proof if this laws is simple: let the variables take all
possible values and compare the results.
Reduction rules are:
A + /A = 1
A./A = 0
AA = A
A+A = A
A + AB = A
(absorbtion law)
AB + A/B = A
proof:
AB + A/B = A(B + /B) = A.1 = A
COMPONENTS
DEVELOPERS
B
0
0
1
1
/(AB)
1
1
1
0
/A + /B
1
1
1
0
/(A + B)
1
0
0
0
/A. /B
1
0
0
0
46
A + /AB = A + B
proof using distributive law 2
A + /AB = (A+/A)(A+B) = 1.(A+B) = A+B
Special are the laws of De Morgan:
/(AB) = /A + /B
/(A + B) = /A. /B
Control:
All input and output data may be saved, loaded or printed.
The Logic10 (Delphi-7) project
There are a form and five units:
- unit1 : event procedures, simple editor, load, save and print
procedures.
- xlate unit : procedures for formula translation and truth table
generation
- logic unit : data and procedures for truth table reduction
- debug unit : originally for testing purposes, later for information
about the translation and reduction.
- help unit : In-Line help information
To keep control over the step-by-step execution, two variables were added:
var continueflag : boolean;
DBwait : boolean;
........ {key event}
if key = #27 then continueflag := false;
Reliability
How can we be sure that the output is reliable?
That not too much information was removed from
the truth table?
Logic10 offers this certainty. After the scans, a
comparison is made between the original formula
and the reduced truth table for all values of the
variables. If results are identical, the final
message is preceded by OK : followed by the
elapsed time.
This concludes the logic10 description.
For details, please refer to the source code.
And in case of commercial use, do not forget a
donation. Contact me at www.davdata.nl
COMPONENTS
DEVELOPERS
51
44
COMPONENTS
DEVELOPERS
expert
TSubImage deprecated
If you have customised a lot of styles in your application
COMPONENTS
DEVELOPERS
53
By Cary Jensen
expert
Temporary connections
Private connections
Persistent connections
Which type of connection you employ determines how the
connection can be used and the features it offers. For
example, the temporary connections that I described in the
preceding article are referred to as unnamed connections.
These connection definitions cannot be shared, and they
cannot be pooled. They are, however, very easy to define at
either runtime or design time, and do not rely on an
external connection definition file.
Persistent connections can be pooled and the
connection definition can be shared by two or more
applications. Private connections can also be pooled.
Unlike persistent connections, however, they can only be
defined at runtime, and cannot be shared between
applications. On the other hand, private connections can be
shared by two or more threads within a single applications
(which is one situation where a private connection's
support for connection pooling can come in handy).
In this article I am going to show you how to create
persistent and private connections. These connections are
named connection, so let me begin by showing you how to
create named connections.
COMPONENTS
DEVELOPERS
59
expert
function TfrmImage.AddZone:boolean;
var z:TkbmFMXImageZone;
begin
z:=kbmFMXImageControl1.NewZone(true);
if Assigned(z) then
begin
z.Kind:=TkbmFMXImageZoneKind.kbmizkCircle;
z.Fill.Color:=TAlphaColorRec.Green;
z.Fill.Kind:=TBrushKind.bkSolid;
z.Opacity:=0.5;
Result:=true;
end
else Result:=false;
end;
procedure TfrmImage.kbmFMXImageControl1ClickZone(
Sender: TObject;
const AZone: TkbmFMXImageZone);
begin
if AZone.Fill.Kind=TBrushKind.bkNone
then AZone.Fill.Kind:=TBrushKind.bkSolid
else AZone.Fill.Kind:=TBrushKind.bkNone;
AZone.Fill.Color:=TAlphaColorRec.Cadetblue;
end;
kbmFMXImageControl1.DisplayAngle := kbmFMXImageControl1.DisplayAngle-45;
Figure 2: Screenshot from actual device looks like above
COMPONENTS
DEVELOPERS
65
kbmFMXFormLayout
with automatic support for scrolling active control so it will be visible when the keyboard is shown,
and to include a close keyboard button to close it again
kbmFMXPaintBox to do fingerpainting (signatures etc)
kbmFMXMemo
is an extension of the existing memo, bugfix
kbmFMXVerticalLayout
shows all its children vertically and autoresizes to fit all children and thus provide vertical scroll
if more children are available than can fit on to the screen
kbmFMXNumberInput
which is a numeric input control, that supports formatting like currency etc. while typing
COMPONENTS
DEVELOPERS
EESB, SOA,MoM, EAI TOOLS FOR INTELLIGENT SOLUTIONS. kbmMW IS THE PREMIERE N-TIER PRODUCT FOR DELPHI / C++BUILDER
BDS DEVELOPMENT FRAMEWORK FOR WIN 32 / 64, .NET AND LINUX WITH CLIENTS RESIDING ON WIN32 / 64, .NET, LINUX, UNIX
MAINFRAMES, MINIS, EMBEDDED DEVICES, SMART PHONES AND TABLETS.