-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path336_digiclock3.txt
727 lines (675 loc) · 21.8 KB
/
336_digiclock3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
PROGRAM DigiClocks3;
// kind of an Idea from bitbox, locs= 625; 13Intf;
// Clock Composition art work #locs=650
// digiclock from the book delphi software praxis, modified on mX by max
// stat.bar dyn time added thanks to IBZ
Const
PicPath = '\examples\';
FBOX = 4;
VAR
//<Variable declarations>
frmMon: TForm;
ShowDate, ShowTime: boolean;
pg,py,pr: Array[0..5] of TPaintBox;
div_dbl: double;
a,b,bin1, bin2, bin3: integer;
//afg: naturalnumber;
arb: TRadioButton;
//acl: TColorBox;
wd: word;
Image1: TImage;
frmsg: TStringGrid;
stat: TStatusbar;
panstep: TPanel;
Progress: TProgressBar;
tm1: TTimer;
ilGreen: TCustomImageList;
ilYellow: TCustomImageList;
ilRed: TCustomImageList;
panRed, panYell, panGreen: TPanel; //Panel und Bildkomponenten je Farbe
pr5, pr4, pr3, pr2, pr1, pr0: TPaintBox;
py5, py4, py3, py2, py1, py0: TPaintBox;
pg5, pg4, pg3, pg2, pg1, pg0: TPaintBox;
pan: TPanel;
mm1: TMainMenu;
mPrg, mmEnde, mAnsicht: TMenuItem;
mmDatum, mmZeit: TMenuItem;
zeit: Array[1..6] of byte;
pb: Array[1..6] of TPaintBox;
pb1, pb2, pb3, pb4, pb5, pb6: TPaintBox; //PaintBoxen zur Zifferndarstellung
imgL: TCustomImageList;
digTimer: TTimer;
Panel1: TPanel;
Label1: TLabel;
// procedure FormActivate(Sender: TObject);
//procedure TimerTimer(Sender: TObject);
//<FUNCTION>
//<PROCEDURE>
Procedure AllBooleanPattern(aX, aY: integer);
begin
Writeln(#13#10+'************** All Booolean Functions **************');
PrintF('%-36s 01 False',[inttobin(0)])
PrintF('%-36s 02 AND',[inttobin(aX AND aY)])
PrintF('%-36s 03 Inhibit',[inttobin(aX AND NOT aY)])
PrintF('%-36s 04 Prepend',[inttobin(aX)])
PrintF('%-36s 05 Praesect',[inttobin(NOT aX AND aY)])
PrintF('%-36s 06 Postpend',[inttobin(aY)])
PrintF('%-36s 07 XOR',[inttobin(aX XOR aY)])
PrintF('%-36s 08 OR',[inttobin(aX OR aY)])
PrintF('%-36s 09 NOR',[inttobin(NOT(aX OR aY))])
PrintF('%-36s 10 Aequival',[inttobin((NOT aX OR aY)AND(NOT aY OR aX))])
PrintF('%-36s 11 NegY',[inttobin(NOT aY)])
PrintF('%-36s 12 ImplicatY',[inttobin(aX OR NOT aY)])
PrintF('%-36s 13 NegX',[inttobin(NOT aX)])
PrintF('%-36s 14 ImplicatX',[inttobin(NOT aX OR aY)])
PrintF('%-36s 15 NAND',[inttobin(NOT(aX AND aY))])
PrintF('%-36s 16 True',[inttobin(NOT 0)])
end;
function getBmp(apath: string): TBitmap;
begin
result:= TBitmap.Create;
with result do try
LoadFromFile(apath);
finally
//Free;
end;
end;
//////////////////// digi clock rock
procedure DigiTForm1_FormActivate(Sender: TObject);
//Startinit on Form
var i,t: integer;
begin
pb[1]:=pb1; pb[2]:=pb2; pb[3]:=pb3;
pb[4]:=pb4; pb[5]:=pb5; pb[6]:=pb6;
for i:= 1 to 6 do zeit[i]:= 0;
imgL:= TCustomImageList.Create(self);
ReadComponentResFile(ExePath+picpath+'MyImageClockList7Segment.dat', imgl);
with imgL do begin
//@Bitmap.DrawMode:= dmBlend //assign; setbounds
Height:= 50;
Width:= 30;
{for t:= 0 to 9 do //image, mask
Add(getbmp(exePath+picpath+'7seg'+inttostr(t)+'.bmp'),
getbmp(exePath+picpath+'7segaus.bmp'));}
end;
//WriteComponentResFile(ExePath+picpath+'MyImageClockList7Segment.dat', imgL);
end;
procedure DigiTForm1_TimerTimer(Sender: TObject);
var i: integer;
s,s1: String;
t: TDateTime;
begin
t:= Now;
//Formate, 6-parts of s
DateTimeToString(s,'hhmmss',t);
//Number assign and draw
for i:= 1 to 6 do begin
s1:= MidStr(s,i,1);
zeit[i]:= strToInt(s1);
imgL.Draw(pb[i].Canvas,1,1,zeit[i],true);
end;
end;
//////////////////////digi clock end
procedure TForm1_FormShow(Sender: TObject);
//Programm-Starteinstellungen
var mask, image: TBitmap;
begin
// Make sure that transparency pixel in the image is taken
//MyImage.Picture.Bitmap.TransparentMode:= tmFixed;
{ ilGreen:= TBitmap32List.Create(self);
with ilGreen do begin
//Bitmap.DrawMode:= dmBlend
bitmaps.add;
bitmap[0]:= getbitmap32(exepath+'\examples\images\green0.bmp');
end;}
pg[0]:=pg0; pg[1]:=pg1; pg[2]:=pg2; pg[3]:=pg3; pg[4]:=pg4; pg[5]:=pg5;
py[0]:=py0; py[1]:=py1; py[2]:=py2; py[3]:=py3; py[4]:=py4; py[5]:=py5;
pr[0]:=pr0; pr[1]:=pr1; pr[2]:=pr2; pr[3]:=pr3; pr[4]:=pr4; pr[5]:=pr5;
ShowDate:=true; ShowTime:=true;
ilGreen:= TCustomImageList.Create(self);
//ReadComponentResFile(ExePath+picpath+'MyImageClockList.dat', ilGreen);
image:= getbitmap(exepath+picpath+'green0.bmp')
mask:= getbitmap(exepath+picpath+'green1.bmp');
with ilGreen do begin
Height:= 39; Width:= 39;
Add(image,NIL);
Add(mask,NIL);
end;
ilyellow:= TCustomImageList.Create(self);
image:= getbitmap(exepath+picpath+'yellow0.bmp')
mask:= getbitmap(exepath+picpath+'yellow1.bmp');
with ilyellow do begin
Height:= 39; Width:= 39;
Add(image,NIL);
Add(mask,NIL);
end;
ilred:= TCustomImageList.Create(self);
image:= getbitmap(exepath+picpath+'red0.bmp')
mask:= getbitmap(exepath+picpath+'red1.bmp');
mask.transparent:= true;
with ilred do begin
Height:= 39; Width:= 39;
Add(image,NIL);
Add(mask,NIL);
end;
//WriteComponentResFile('MyImageClockList.dat', ilGreen);
//ReadComponentResFile('MyImageClockList.dat', ilGreen);
//tm1.Enabled:=true;
end;
procedure TForm1_tm1Timer(Sender: TObject);
var
i,zh,zm,zs,p: integer;
t,m,j,hh,mm,ss,ms: Word;
mtime: TDateTime;
s,s1,s2: String;
begin
mtime:= Now; s:= '';
DecodeDate(mTime,j,m,t);
DecodeTime(mTime,hh,mm,ss,ms);
DateTimeToString(s1,'dd.mm.yyyy',mTime);
DateTimeToString(s2,' hh:mm:ss',mTime);
if ShowDate then s:=s+s1; //+#9;
if ShowTime then s:=s+s2;
if s='' then s:=' ... the real binarytime ... ';
pan.Caption:= s;
p:= 1;
for i:= 0 to 5 do begin //Binaries cut and draw
//zh:=0; if (hh and p)<>0 then zh:=1;
//zm:=0; if (mm and p)<>0 then zm:=1;
//zs:=0; if (ss and p)<>0 then zs:=1;
zh:=(hh and p) shr i;
zm:=(mm and p) shr i;
zs:=(ss and p) shr i;
//pr[i].canvas.draw(Rect.Left, Rect.Top, TBitmap(ilRed[0]));
//py[i].canvas.draw(Rect.Left, Rect.Top, TBitmap(ilRed[0]));
//pg[i].canvas.draw(Rect.Left, Rect.Top, TBitmap(ilRed[0]));
ilRed.Draw(pr[i].Canvas,1,2,zh,true);
ilYellow.Draw(py[i].Canvas,1,2,zm,true);
ilGreen.Draw(pg[i].Canvas,1,2,zs,true);
frmsg.Cells[0,1]:= 'Dez';
frmsg.Cells[1,1]:= inttoStr(hh);
frmsg.Cells[2,1]:= inttoStr(mm);
frmsg.Cells[3,1]:= inttoStr(ss);
frmsg.Cells[0,2]:= 'Hex';
frmsg.Cells[1,2]:= inttohex(hh,3);
frmsg.Cells[2,2]:= inttohex(mm,3);
frmsg.Cells[3,2]:= inttohex(ss,3);
Progress.Position:= (hh * 60)+mm;
panStep.Caption:= formatFloat('0',(((hh*60)+mm)/1440)*100)+' %'; //prorgess
p:= p*2;
end;
stat.SimpleText:='Clock Composition Dyn is running ...at: '+DateTimeToInternetStr(now, true);
end;
procedure TForm1_mmDatumClick(Sender: TObject);
begin
mmDatum.Checked:= not mmDatum.Checked;
ShowDate:= mmDatum.Checked;
end;
procedure TForm1_mmZeitClick(Sender: TObject);
begin
mmZeit.Checked:= not mmZeit.Checked;
ShowTime:= mmZeit.Checked;
end;
procedure btnCloseClick(Sender: TObject);
begin
stat.SimpleText:= 'Closed Clicked';
//il.Free;
frmMon.Close;
end;
procedure CloseClick(Sender: TObject; var action: TCloseAction);
begin
//if MessageDlg('Wanna Leave?',mtConfirmation,[mbYes, mbNo],0)= mrYes then begin
//form1.Free; //bmp.Free;
if digtimer <> NIL then begin
digtimer.enabled:= false;
digtimer.Free;
digtimer:= NIL;
end;
if tm1 <> NIL then begin
tm1.enabled:= false;
tm1.Free;
tm1:= NIL;
end;
action:= caFree;
imgL.Free;
ilGreen.Free;
ilRed.Free;
ilyellow.Free;
frmMon:= NIL;
screen.cursor:= crDefault;
//showmessage('free');
writeln('Digi Free and Closer test finished');
//end else
//Action:= caNone;
end;
//*************************Form Create********************************//
procedure InitCreateForms;
var panImg, panR: TPanel;
//mis : array[0..3] of TMenuItem;
begin
// seq --> panel-image-drawgrid-bitmap
//panimg1.DoubleBuffered:= true;
frmMon:= TForm.Create(self);
with frmMon do begin
//FormStyle := fsStayOnTop;
Position:= poScreenCenter;
BorderIcons:= [biSystemMenu, biMinimize];
BorderStyle:= bsSingle;
PixelsPerInch:= 96;
caption:='22 Clocks around the Socks';
color:= clteal;
width:= 650;
height:= 540;
Menu:= mm1;
Show;
canvas.brush.bitmap:= getBitmapObject(Exepath+'examples\timer2.bmp');
Canvas.FillRect(Rect(340,335,430,50))
//image:= getbitmap(exepath+picpath+'green0.bmp')
onClose:= @CloseClick;
end;
Screen.cursor:= crHourGlass;
Panel1:= TPanel.Create(frmMon)
with panel1 do begin
parent:= frmMon;
SetBounds(18,18,241,65);
BevelOuter:= bvLowered;
Color:= clBlack;
TabOrder:= 0;
end;
pb1:= TPaintBox.Create(frmMon);
with pb1 do begin
parent:= panel1;
SetBounds(8,8,30,50);
end;
pb2:= TPaintBox.Create(frmMon);
with pb2 do begin
parent:= panel1;
SetBounds(40,8,30,50);
end;
pb3:= TPaintBox.Create(frmMon);
with pb3 do begin
parent:= panel1;
SetBounds(88,8,30,50);
end;
pb4:= TPaintBox.Create(frmMon);
with pb4 do begin
parent:= panel1;
SetBounds(120,8,30,50);
end;
pb5:= TPaintBox.Create(frmMon);
with pb5 do begin
parent:= panel1;
SetBounds(168,8,30,50);
end;
pb6:= TPaintBox.Create(frmMon);
with pb6 do begin
parent:= panel1;
SetBounds(200,8,30,50);
end;
with TLabel.Create(self) do begin
SetBounds(74,12,10,38);
parent:= panel1;
Caption:= ':';
Font.Charset:= ANSI_CHARSET;
Font.Color:= clGreen;
Font.Height:= -27;
Font.Name:= 'Arial Black';
Font.Style:= [fsBold];
ParentFont:= False;
end;
with TLabel.Create(self) do begin
SetBounds(154,12,10,38);
parent:= panel1;
Caption:= ':';
Font.Charset:= ANSI_CHARSET;
Font.Color:= clGreen;
Font.Height:= -27;
Font.Name:= 'Arial Black';
Font.Style:= [fsBold];
ParentFont:= False;
end;
//////////digi binary controls
Pan:= TPanel.Create(frmMon) //just set text time
with pan do begin
parent:= frmMon;
SetBounds(18,350,312,45);
//BevelOuter:= bvLowered;
BevelOuter:= bvLowered
//Color:= clBtnHighlight;
Color:= clred;
Font.Style:= [fsBold];
Font.Size:= 20;
Font.Color:= clwhite;
TabOrder:= 0;
end;
Panred:= TPanel.Create(frmMon)
with panred do begin
parent:= frmMon;
SetBounds(18,150,240,40);
BevelOuter:= bvLowered;
//transparent;
Color:= clwhite;
TabOrder:= 0;
end;
pr5:= TPaintBox.Create(frmMon);
pr5.parent:= panred;
pr5.SetBounds(0,0,39,39);
pr4:= TPaintBox.Create(frmMon);
pr4.parent:= panred;
pr4.SetBounds(40,0,39,39);
pr3:= TPaintBox.Create(frmMon);
pr3.parent:= panred;
pr3.SetBounds(80,0,39,39);
pr2:= TPaintBox.Create(frmMon);
pr2.parent:= panred;
pr2.SetBounds(120,0,39,39);
pr1:= TPaintBox.Create(frmMon);
pr1.parent:= panred;
pr1.SetBounds(160,0,39,39);
pr0:= TPaintBox.Create(frmMon);
pr0.parent:= panred;
pr0.SetBounds(200,0,39,39);
Panyell:= TPanel.Create(frmMon)
with panyell do begin
parent:= frmMon;
SetBounds(18,200,240,40);
BevelOuter:= bvLowered;
Color:= clWhite;
TabOrder:= 0;
end;
py5:= TPaintBox.Create(frmMon);
py5.parent:= panyell;
py5.SetBounds(0,0,39,39);
py4:= TPaintBox.Create(frmMon);
py4.parent:= panyell;
py4.SetBounds(40,0,39,39);
py3:= TPaintBox.Create(frmMon);
py3.parent:= panyell;
py3.SetBounds(80,0,39,39);
py2:= TPaintBox.Create(frmMon);
py2.parent:= panyell;
py2.SetBounds(120,0,39,39);
py1:= TPaintBox.Create(frmMon);
py1.parent:= panyell;
py1.SetBounds(160,0,39,39);
py0:= TPaintBox.Create(frmMon);
py0.parent:= panyell;
py0.SetBounds(200,0,39,39);
Pangreen:= TPanel.Create(frmMon)
with pangreen do begin
parent:= frmMon;
SetBounds(18,250,240,40);
BevelOuter:= bvLowered;
Color:= clWhite;
TabOrder:= 0;
end;
pg5:= TPaintBox.Create(frmMon);
pg5.parent:= pangreen;
pg5.SetBounds(0,0,39,39);
pg4:= TPaintBox.Create(frmMon);
pg4.parent:= pangreen;
pg4.SetBounds(40,0,39,39);
pg3:= TPaintBox.Create(frmMon);
pg3.parent:= pangreen;
pg3.SetBounds(80,0,39,39);
pg2:= TPaintBox.Create(frmMon);
pg2.parent:= pangreen;
pg2.SetBounds(120,0,39,39);
pg1:= TPaintBox.Create(frmMon);
pg1.parent:= pangreen;
pg1.SetBounds(160,0,39,39);
pg0:= TPaintBox.Create(frmMon);
pg0.parent:= pangreen;
pg0.SetBounds(200,0,39,39);
DigiTForm1_FormActivate(Self);
digtimer:= TTimer.Create(self);
digtimer.enabled:= true;
digtimer.onTimer:= @DigiTForm1_TimerTimer;
digtimer.interval:= 1000;
TForm1_FormShow(Self);
tm1:= TTimer.Create(self);
tm1.enabled:= true;
tm1.onTimer:= @TForm1_tm1Timer;
tm1.interval:= 1000;
PanR:= TPanel.create(frmMon);
with PanR do begin
parent:= frmMon;
setBounds(472,9,155,450);
BevelOuter:= bvLowered
end;
with TBitBtn.Create(frmMon) do begin
Parent:= frmMon;
SetBounds(488,30,121,30) //30
Caption:= 'Load Clock'
Hint:= 'Load your own clock picture!';
ShowHint:= true;
glyph.LoadFromResourceName(getHINSTANCE,'CL_MPEJECT');
//OnClick:= @BtnPictureLoad;
end;
with TBitBtn.Create(frmMon) do begin
Parent:= frmMon;
SetBounds(488,68,121,30) //68
glyph.LoadFromResourceName(getHINSTANCE,'CL_MPSTEP');
Caption:= 'New Clock'
//Enabled:= False
//OnClick:= @btnNewClockClick
end;
with TBitBtn.Create(frmMon) do begin
Parent:= frmMon;
SetBounds(488,420,121,30)
glyph.LoadFromResourceName(getHINSTANCE,'CL_MPSTOP');
Caption:= 'Close'
OnClick:= @btnCloseClick
end;
panstep:= TPanel.Create(frmMon);
with panstep do begin
Parent:= frmMon;
SetBounds(488,120,121,25)
BevelOuter:= bvLowered
Caption:= '0 %'
Color:= clyellow;//$30809000;
//Color:= 8404992
end;
frmsg:= TStringGrid.Create(frmMon);
with frmsg do begin
//SetBounds(512,320,79,79)
parent:= frmMon;
Left:= 500; Top:= 320;
Width:= 95; Height:= 79;
ColCount:= 4
DefaultColWidth:= 22
DefaultRowHeight:= 18
FixedCols:= 0
RowCount:= 4
FixedRows:= 0
end;
with TJvAnalogClock.Create(frmMon) do begin
parent:= PanR;
bevelwidth:= 0;
colormin:= clblue;
//transparent
//repaint;
//timeoffSet:= -60;
align:= alclient;
ColorHr:= clRed;
Color:= clTeal;
//WidthHandHr:= 1;
ColorHandHr:= clRed;
ColorHandMin:= clRed;
setBounds(28,5,100,100);
centercol:= clyellow; //cldarkblue32; //clwebgold;
centersize:= 8;
end;
with TLabel.Create(frmMon) do begin
Parent:= PanR;
SetBounds(18,140,50,18)
Caption:= 'Progress:'
bringtofront;
end;
with TLabel.Create(frmMon) do begin
Parent:= PanR;
SetBounds(18,290,50,18)
Caption:= 'Navigation:'
end;
mm1:= TMainMenu.Create(frmMon);
mPrg:= TMenuItem.Create(frmMon);
mPrg.Caption:= 'Program';
mm1.Items.Add(mPrg);
//mm1.Items[0].Add(mPrg);
mmEnde:= TMenuItem.Create(frmmon)
with mmEnde do begin
//parent:= mPrg;
Caption:= 'Shotdown'
tag:= mprg;
//submenu.add
//items[0].add(mprg);
OnClick:= @btnCloseClick;
end;
mprg.add(mmende);
//SubItem:= TMenuItem.Create(MainMenu1);
//MainMenu1.Items[0].Add(SubItem);
//mPrg.Items[mmEnde];
mAnsicht:= TMenuItem.Create(frmMon);
mAnsicht.Caption:= 'View';
mm1.Items.Add(mAnsicht);
mmDatum:= TMenuItem.Create(mAnsicht);
with mmdatum do begin
Caption:= 'Date';
Checked:= True;
OnClick:= @TForm1_mmDatumClick;
end;
mAnsicht.Add(mmdatum);
mmZeit:= TMenuItem.Create(mAnsicht);
with mmZeit do begin
Caption:= 'Time';
Checked:= True;
OnClick:= @TForm1_mmZeitClick;
end;
mAnsicht.Add(mmzeit);
frmMon.Menu:= mm1;
stat:= TStatusbar.Create(FrmMon);
with Stat do begin
parent:= frmMon;
stat.SimplePanel:= true;
end;
stat.SimpleText:='Clock Composition is running ...at: '+DateTimeToInternetStr(now, true);
Progress:= TProgressBar.Create(frmMon);
with progress do begin
parent:= frmMon;
Align:= alBottom;
//step:= 10;
Max:= (24*60);
end;
end;
var sysinfo: TSystemInfo;
BEGIN //Main APP
//<Executable statements>
div_dbl:= 5.0 / 2.0; // 2.500000
writeln(Format('%0.6f', [div_dbl]))
div_dbl:= 20 mod 3; // 2.00000
writeln(Format('%f', [div_dbl]))
a:= 5; b:= 6;
if not (A<>B) then writeln('even') else
writeln('odd');
if (A=B) then writeln('even') else
writeln('odd');
// wholee ASCII Table
{ writeln(Chr(67))
for i:= 0 to 255 do
writeln(format('wert %d %s',[i, Chr(i)]))}
writeln(Format('%s',[inttobin(97)]))
writeln(Format('%s',[inttobin(223)]))
writeln(Format('%s',[inttobin(97 XOR 223)]))
bin1:= 97; bin2:= 223;
bin3:= bin1 XOR bin2;
writeln(Format('%s',[IntToBin(bin3)]))
writeln(' ');
wd:= 150;
writeln('first '+IntToBin(wd))
writeln(IntToStr(wd))
//double the value
wd:= wd SHL 1
writeln('double '+IntToBin(wd))
writeln(IntToStr(wd))
//half the value
wd:= wd SHR 1
writeln('half '+IntToBin(wd))
writeln(IntToStr(wd))
//init the value
writeln('init '+IntToBin(wd))
writeln(' '+IntToBin(wd XOR wd))
AllBooleanPattern(10,12);
InitCreateForms;
with tradiogroup.create(self) do begin
//flipchildren
free;
end;
GetSystemInfo(sysinfo);
writeln(inttostr(sysinfo.wProcessorLevel));
writeln(inttostr(sysinfo.dwProcessorType));
if openmapX('church trier') then
writeln('done gone')
END.
(A<>B) NOT --> A=B
0 0 0 1 0 0
0 1 1 0
1 0 1 0
1 1 0 1 1 1
//19.8. um 16 Uhr PT1 Update
XOR App
0110 0001
^ 1101 1111
-----------
1011 1110
00000000000000000000000100101100 XOR
00000000000000000000000100101100
000000000
00000000000000000000000000000000 01 False
00000000000000000000000000001000 02 AND
00000000000000000000000000000010 03 Inhibit
00000000000000000000000000001010 04 Prepend
00000000000000000000000000000100 05 Praesect
00000000000000000000000000001100 06 Postpend
00000000000000000000000000000110 07 XOR
00000000000000000000000000001110 08 OR
11111111111111111111111111110001 09 NOR
11111111111111111111111111111001 10 Aequival
11111111111111111111111111110011 11 NegY
11111111111111111111111111111011 12 ImplicatY
11111111111111111111111111110101 13 NegX
11111111111111111111111111111101 14 ImplicatX
11111111111111111111111111110111 15 NAND
11111111111111111111111111111111 16 True
----app_template_loaded----
{K:= add(getbmp(exepath+picpath+'7seg0.bmp'),getbmp(exepath+picpath+'7segaus.bmp'));
k:= add(getbmp(exepath+'\examples\images\7seg1.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg2.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg3.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg4.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg5.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg6.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg7.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg8.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));
add(getbmp(exepath+'\examples\images\7seg9.bmp'),getbmp(exepath+'\examples\images\7segaus.bmp'));}
Lets say you have placed Image list and an Image on your form and populated the list with few state images
var
MyImageList: TImageList;
MyImage: TImage;
Canvas
That is probably the easiest case. Lets draw an image on canvas of some control (OwnerDraw situation) and also center it. X, Y are top left corner of the future image and Width is a width of the rectangle we want to center image in.
MyImageIndex is an index of the image in the Image List.
?
1
MyImageList.Draw(Canvas, X + Width div 2 - MyImageList.Width div 2, Y, MyImageIndex, dsNormal, itImage);
TImage
Being a little bit more complex, it does require some extra code.
// Make sure that any prior state is cleared.
// If you do not do that with transparency enabled, you would see
// images on top of each other
MyImage.Picture.Bitmap := nil;
// Make sure that transparency pixel in the image is taken
// in consideration
MyImage.Picture.Bitmap.TransparentMode := tmFixed;
MyImage.Picture.Bitmap.TransparentColor := clWhite;
// Load image from the Image list into TImage
MyImageList.GetBitmap(MyImageIndex, MyImage.Picture.Bitmap);