Merhabalar
Öncelikle kodunu yazarken setupcomponent ile yazmamanı istiyorum clProsettings ile yazmanı istiyorum.
kodlama da kullandığında tag yalnız doğrusu clTagStr olması gerekli
var MyForm: TclForm; TitleLabel, InfoLabel: TclProLabel; CylinderPanel: TclProPanel; Liquid1, Liquid2, Liquid3, Liquid4, Liquid5: TclProPanel; BtnBal, BtnSabun, BtnSu, BtnYag, BtnAlkol: TclProButton; MainVertBox, BtnFlowBox: TclLayout; CurrentStep: Integer; LabImage: TclImage;
void SetupLiquids; { Liquid1.Visible = False; Liquid2.Visible = False; Liquid3.Visible = False; Liquid4.Visible = False; Liquid5.Visible = False; CurrentStep = 1; }
void CheckDensity; var ClickedTag: Integer; SenderBtn: TclProButton; { SenderBtn = TclProButton(MyForm.clSender); ClickedTag = SenderBtn.clTagInt; if (ClickedTag == CurrentStep) { if (CurrentStep == 1) { Liquid1.Visible = True; ShowMessage('Bal (d=1.42) en yoğun olduğu için en alta yerleşti!'); } else if (CurrentStep == 2) { Liquid2.Visible = True; ShowMessage('Bulaşık Sabunu (d=1.06) Balın üzerine çıktı.'); } else if (CurrentStep == 3) { Liquid3.Visible = True; ShowMessage('Su (d=1.00) Sabunun üzerinde duruyor.'); } else if (CurrentStep == 4) { Liquid4.Visible = True; ShowMessage('Zeytinyağı (d=0.92) Suyun üstünde yüzüyor!'); } else if (CurrentStep == 5) { Liquid5.Visible = True; ShowMessage('Tebrikler! Alkol (d=0.80) en üstte. Yoğunluk Kulesi Tamamlandı!'); } CurrentStep = CurrentStep + 1; } else { ShowMessage('Hatalı Sıralama! Yoğunluğu daha fazla olan bir madde seçmelisin.'); } }
{ MyForm = TclForm.Create(Self); LabImage = MyForm.AddNewImage(MyForm, 'LabImage'); LabImage.Align = alContents; MyForm.SetImage(LabImage, ' https://img.freepik.com/free-vector/empty-science-laboratory-scene_1308-59178.jpg" rel="nofollow - https://img.freepik.com/free-vector/empty-science-laboratory-scene_1308-59178.jpg ');
MainVertBox = MyForm.AddNewLayout(MyForm, 'MainVertBox'); MainVertBox.Align = alContents;
TitleLabel = MyForm.AddNewProLabel(MainVertBox, 'TitleLabel', 'FEN BİLGİSİ: YOĞUNLUK KULESİ'); TitleLabel.Align = alTop; TitleLabel.Height = 40; TitleLabel.Margins.Top = 20; TitleLabel.clProSettings.FontSize = 22; TitleLabel.clProSettings.FontColor = clAlphaColor.clWhite; TitleLabel.clProSettings.FontHorzAlign = palCenter; TitleLabel.clProSettings.TextSettings.Font.Style = [fsBold]; TitleLabel.SetclProSettings(TitleLabel.clProSettings);
InfoLabel = MyForm.AddNewProLabel(MainVertBox, 'InfoLabel', 'Sıvıları en yoğundan en az yoğuna doğru mezüre ekle!'); InfoLabel.Align = alTop; InfoLabel.Height = 30; InfoLabel.clProSettings.FontSize = 14; InfoLabel.clProSettings.FontColor = clAlphaColor.clHexToColor('#E1E1E1'); InfoLabel.clProSettings.FontHorzAlign = palCenter; InfoLabel.SetclProSettings(InfoLabel.clProSettings);
CylinderPanel = MyForm.AddNewProPanel(MainVertBox, 'CylinderPanel'); CylinderPanel.Align = alCenter; CylinderPanel.Width = 150; CylinderPanel.Height = 350; CylinderPanel.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#50FFFFFF'); CylinderPanel.clProSettings.BorderColor = clAlphaColor.clWhite; CylinderPanel.clProSettings.BorderWidth = 2; CylinderPanel.clProSettings.RoundWidth = 20; CylinderPanel.clProSettings.RoundHeight = 20; CylinderPanel.SetclProSettings(CylinderPanel.clProSettings);
Liquid1 = MyForm.AddNewProPanel(CylinderPanel, 'Liquid1'); Liquid1.Align = alBottom; Liquid1.Height = 60; Liquid1.Margins.Left = 5; Liquid1.Margins.Right = 5; Liquid1.Margins.Bottom = 5; Liquid1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#8B4513'); Liquid1.clProSettings.RoundWidth = 10; Liquid1.clProSettings.RoundHeight = 10; Liquid1.SetclProSettings(Liquid1.clProSettings);
Liquid2 = MyForm.AddNewProPanel(CylinderPanel, 'Liquid2'); Liquid2.Align = alBottom; Liquid2.Height = 60; Liquid2.Margins.Left = 5; Liquid2.Margins.Right = 5; Liquid2.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#228B22'); Liquid2.SetclProSettings(Liquid2.clProSettings);
Liquid3 = MyForm.AddNewProPanel(CylinderPanel, 'Liquid3'); Liquid3.Align = alBottom; Liquid3.Height = 60; Liquid3.Margins.Left = 5; Liquid3.Margins.Right = 5; Liquid3.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#00BFFF'); Liquid3.SetclProSettings(Liquid3.clProSettings);
Liquid4 = MyForm.AddNewProPanel(CylinderPanel, 'Liquid4'); Liquid4.Align = alBottom; Liquid4.Height = 60; Liquid4.Margins.Left = 5; Liquid4.Margins.Right = 5; Liquid4.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FFD700'); Liquid4.SetclProSettings(Liquid4.clProSettings);
Liquid5 = MyForm.AddNewProPanel(CylinderPanel, 'Liquid5'); Liquid5.Align = alBottom; Liquid5.Height = 60; Liquid5.Margins.Left = 5; Liquid5.Margins.Right = 5; Liquid5.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FF4500'); Liquid5.SetclProSettings(Liquid5.clProSettings);
BtnFlowBox = MyForm.AddNewLayout(MainVertBox, 'BtnFlowBox'); BtnFlowBox.Align = alBottom; BtnFlowBox.Height = 180;
BtnBal = MyForm.AddNewProButton(BtnFlowBox, 'BtnBal', 'BAL (1.42)'); BtnBal.Align = alTop; BtnBal.Height = 30; BtnBal.Margins.Left = 50; BtnBal.Margins.Right = 50; BtnBal.Margins.Top = 5; BtnBal.clTagInt = 1; // Tag ataması BtnBal.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#8B4513'); BtnBal.clProSettings.FontColor = clAlphaColor.clWhite; BtnBal.clProSettings.RoundWidth = 10; BtnBal.clProSettings.RoundHeight = 10; BtnBal.SetclProSettings(BtnBal.clProSettings); MyForm.AddNewEvent(BtnBal, tbeonclick, 'CheckDensity');
BtnSabun = MyForm.AddNewProButton(BtnFlowBox, 'BtnSabun', 'SABUN (1.06)'); BtnSabun.Align = alTop; BtnSabun.Height = 30; BtnSabun.Margins.Left = 50; BtnSabun.Margins.Right = 50; BtnSabun.Margins.Top = 5; BtnSabun.clTagInt = 2; BtnSabun.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#228B22'); BtnSabun.clProSettings.FontColor = clAlphaColor.clWhite; BtnSabun.clProSettings.RoundWidth = 10; BtnSabun.clProSettings.RoundHeight = 10; BtnSabun.SetclProSettings(BtnSabun.clProSettings); MyForm.AddNewEvent(BtnSabun, tbeonclick, 'CheckDensity');
BtnSu = MyForm.AddNewProButton(BtnFlowBox, 'BtnSu', 'SU (1.00)'); BtnSu.Align = alTop; BtnSu.Height = 30; BtnSu.Margins.Left = 50; BtnSu.Margins.Right = 50; BtnSu.Margins.Top = 5; BtnSu.clTagInt = 3; BtnSu.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#00BFFF'); BtnSu.clProSettings.FontColor = clAlphaColor.clWhite; BtnSu.clProSettings.RoundWidth = 10; BtnSu.clProSettings.RoundHeight = 10; BtnSu.SetclProSettings(BtnSu.clProSettings); MyForm.AddNewEvent(BtnSu, tbeonclick, 'CheckDensity');
BtnYag = MyForm.AddNewProButton(BtnFlowBox, 'BtnYag', 'YAĞ (0.92)'); BtnYag.Align = alTop; BtnYag.Height = 30; BtnYag.Margins.Left = 50; BtnYag.Margins.Right = 50; BtnYag.Margins.Top = 5; BtnYag.clTagInt = 4; BtnYag.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FFD700'); BtnYag.clProSettings.FontColor = clAlphaColor.clBlack; BtnYag.clProSettings.RoundWidth = 10; BtnYag.clProSettings.RoundHeight = 10; BtnYag.SetclProSettings(BtnYag.clProSettings); MyForm.AddNewEvent(BtnYag, tbeonclick, 'CheckDensity');
BtnAlkol = MyForm.AddNewProButton(BtnFlowBox, 'BtnAlkol', 'ALKOL (0.80)'); BtnAlkol.Align = alTop; BtnAlkol.Height = 30; BtnAlkol.Margins.Left = 50; BtnAlkol.Margins.Right = 50; BtnAlkol.Margins.Top = 5; BtnAlkol.clTagInt = 5; BtnAlkol.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FF4500'); BtnAlkol.clProSettings.FontColor = clAlphaColor.clWhite; BtnAlkol.clProSettings.RoundWidth = 10; BtnAlkol.clProSettings.RoundHeight = 10; BtnAlkol.SetclProSettings(BtnAlkol.clProSettings); MyForm.AddNewEvent(BtnAlkol, tbeonclick, 'CheckDensity');
SetupLiquids; MyForm.Run; } https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/v8c78df7c7c0f484497ecbca7046644da1771523124516" integrity="sha512-8DS7rgIrAmghBFwoOTujcf6D9rXvH8xm8JQ1Ja01h9QX8EzXldiszufYa4IFfKdLUKTTrnSFXLDkUEOTrZQ8Qg==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|