Clomosy | Forum Ana Sayfa
Forum Anasayfa Forum Anasayfa > Genel Programlama > Genel İşlemler
  Aktif Konular Aktif Konular RSS - KOD HATA
  SSS SSS  Forumu Ara   Etkinlikler   Kayıt Ol Kayıt Ol  Giriş Giriş

Clomosy Resmi Forum Sitesidir. Amacımız kullanıcılarımıza, iş ortaklarımıza, danışmanlara, yazılımcılara programlarımız hakkında destek ve bilgi vermektir.

KOD HATA

 Yanıt Yaz Yanıt Yaz
Yazar
Mesaj
  Konu Arama Konu Arama  Topic Seçenekleri Topic Seçenekleri
Yasemin Açılır Kutu İzle
Yeni Üye
Yeni Üye
Simge

Kayıt Tarihi: 15 Saat 13 Dakika Önce
Konum: Konya
Durum: Aktif Değil
Puanlar: 2
Mesaj Seçenekleri Mesaj Seçenekleri   Teşekkürler (0) Teşekkürler(0)   Alıntı Yasemin Alıntı  Yanıt YazCevapla Mesajın Direkt Linki Konu: KOD HATA
    Gönderim Zamanı: 12 Saat 38 Dakika Önce Saat 14:06
8.sınıf müfredatında bulunan periyodik tablo konusundaki ilk 18 element ile ilgili sanal laboratuvar uygulaması hazırlamak istiyorum.Aynı zamada uygulama elementleri metal, ametal,soygaz olarak sınıflandıracak şekilde tasarlanmış olmalıdır.Bu uygulamanın çalışması için gerekli kodu yazmaya çalıştım ancak hata verdi.Hata nereden kaynaklanıyor olabilir.Yardımcı olabilir misiniz?

Var
  MyForm: TclForm;
  TitleLabel, InfoLabel: TclLabel;
  LayoutTop, LayoutTable, LayoutButtons: TclLayout;
  // Sınıflandırma Butonları
  BtnMetal, BtnAmetal, BtnYarimetal, BtnSoygaz: TclButton;
  SelectedElement: String;
  SelectedBtn: TclButton;
  
  // Periyodik Tablo Element Butonları (İlk 18 Element)
  Btn1, Btn2, Btn3, Btn4, Btn5, Btn6, Btn7, Btn8, Btn9, Btn10: TclButton;
  Btn11, Btn12, Btn13, Btn14, Btn15, Btn16, Btn17, Btn18: TclButton;

// Element seçildiğinde çalışacak fonksiyon
void ElementSelect;
var
  ClickedBtn: TclButton;
begin
  ClickedBtn := TclButton(MyForm.clSender);
  SelectedElement := ClickedBtn.Caption;
  SelectedBtn := ClickedBtn;
  
  InfoLabel.Text := 'Seçilen Element: ' + SelectedElement + ' -> Şimdi alttaki butonlardan sınıfını seçerek ETİKETLEYİN.';
  InfoLabel.StyledSettings := [];
  InfoLabel.Font.Color := clAlphaColor.clHexToColor('#2c3e50');
end;

// Sınıf seçildiğinde kontrol eden fonksiyon
void CheckClassification;
var
  ClickedClassBtn: TclButton;
  UserChoice, CorrectClass: String;
begin
  if SelectedElement = '' then
  begin
    ShowMessage('Lütfen önce periyodik tablodan bir element seçiniz!');
    Exit;
  end;

  ClickedClassBtn := TclButton(MyForm.clSender);
  UserChoice := ClickedClassBtn.Caption;
  CorrectClass := '';

  // 1-18 Element Doğrulama Mantığı
  if (SelectedElement = 'H') or (SelectedElement = 'C') or (SelectedElement = 'N') or 
     (SelectedElement = 'O') or (SelectedElement = 'F') or (SelectedElement = 'P') or 
     (SelectedElement = 'S') or (SelectedElement = 'Cl') then 
    CorrectClass := 'Ametal'
  else if (SelectedElement = 'He') or (SelectedElement = 'Ne') or (SelectedElement = 'Ar') then 
    CorrectClass := 'Soy Gaz'
  else if (SelectedElement = 'Li') or (SelectedElement = 'Be') or (SelectedElement = 'Na') or 
          (SelectedElement = 'Mg') or (SelectedElement = 'Al') then 
    CorrectClass := 'Metal'
  else if (SelectedElement = 'B') or (SelectedElement = 'Si') then 
    CorrectClass := 'Yarımetal';

  // Sonuç ve Etiketleme Kontrolü
  if UserChoice = CorrectClass then
  begin
    InfoLabel.Text := 'Doğru! ' + SelectedElement + ' elementi bir ' + CorrectClass + 'dır.';
    InfoLabel.Font.Color := clAlphaColor.clHexToColor('#27ae60');
    
    // Doğru bilinince Tablo Üzerinde Renkli Gruplandırma yapılıyor
    if CorrectClass = 'Metal' then SelectedBtn.BackgroundColor := clAlphaColor.clHexToColor('#e74c3c')
    else if CorrectClass = 'Ametal' then SelectedBtn.BackgroundColor := clAlphaColor.clHexToColor('#3498db')
    else if CorrectClass = 'Yarımetal' then SelectedBtn.BackgroundColor := clAlphaColor.clHexToColor('#f1c40f')
    else if CorrectClass = 'Soy Gaz' then SelectedBtn.BackgroundColor := clAlphaColor.clHexToColor('#9b59b6');
  end
  else
  begin
    InfoLabel.Text := 'Hatalı! ' + SelectedElement + ' elementi ' + UserChoice + ' değildir.';
    InfoLabel.Font.Color := clAlphaColor.clHexToColor('#c0392b');
  end;
  
  SelectedElement := '';
end;

// Ana Kod Bloğu
begin
  MyForm := TclForm.Create(Self);
  MyForm.Title := 'Periyodik Tablo Etiketleme Laboratuvarı';
  SelectedElement := '';

  // Üst Bilgilendirme Paneli
  LayoutTop := MyForm.AddNewLayout(MyForm, 'LayoutTop');
  LayoutTop.Align := alTop;
  LayoutTop.Height := 100;

  TitleLabel := MyForm.AddNewLabel(LayoutTop, 'TitleLabel', 'FB.8.5.1.1 Periyodik Tablo Sanal Laboratuvarı');
  TitleLabel.Align := alTop;
  TitleLabel.TextSettings.Font.Size := 15;
  TitleLabel.TextSettings.Font.Style := [fsBold];
  TitleLabel.TextSettings.HorzAlign := txCenter;

  InfoLabel := MyForm.AddNewLabel(LayoutTop, 'InfoLabel', 'Tablodan bir element seçip alttaki gruplarla eşleştirin.');
  InfoLabel.Align := alClient;
  InfoLabel.Margins.Left := 10; InfoLabel.Margins.Right := 10;
  InfoLabel.TextSettings.Font.Size := 12;
  InfoLabel.TextSettings.HorzAlign := txCenter;
  InfoLabel.TextSettings.WordWrap := True;

  // PERİYODİK TABLO ALANI (Koordinatlı Yerleşim)
  LayoutTable := MyForm.AddNewLayout(MyForm, 'LayoutTable');
  LayoutTable.Align := alClient;
  LayoutTable.Margins.Left := 10; LayoutTable.Margins.Top := 10;

  // 1. Periyot (Satır 1)
  Btn1 := MyForm.AddNewButton(LayoutTable, 'Btn1', 'H');  Btn1.Width := 40; Btn1.Height := 40; Btn1.Position.X := 0; Btn1.Position.Y := 0;
  Btn2 := MyForm.AddNewButton(LayoutTable, 'Btn2', 'He'); Btn2.Width := 40; Btn2.Height := 40; Btn2.Position.X := 280; Btn2.Position.Y := 0;

  // 2. Periyot (Satır 2)
  Btn3 := MyForm.AddNewButton(LayoutTable, 'Btn3', 'Li'); Btn3.Width := 40; Btn3.Height := 40; Btn3.Position.X := 0; Btn3.Position.Y := 45;
  Btn4 := MyForm.AddNewButton(LayoutTable, 'Btn4', 'Be'); Btn4.Width := 40; Btn4.Height := 40; Btn4.Position.X := 45; Btn4.Position.Y := 45;
  Btn5 := MyForm.AddNewButton(LayoutTable, 'Btn5', 'B');  Btn5.Width := 40; Btn5.Height := 40; Btn5.Position.X := 120; Btn5.Position.Y := 45;
  Btn6 := MyForm.AddNewButton(LayoutTable, 'Btn6', 'C');  Btn6.Width := 40; Btn6.Height := 40; Btn6.Position.X := 160; Btn6.Position.Y := 45;
  Btn7 := MyForm.AddNewButton(LayoutTable, 'Btn7', 'N');  Btn7.Width := 40; Btn7.Height := 40; Btn7.Position.X := 200; Btn7.Position.Y := 45;
  Btn8 := MyForm.AddNewButton(LayoutTable, 'Btn8', 'O');  Btn8.Width := 40; Btn8.Height := 40; Btn8.Position.X := 240; Btn8.Position.Y := 45;
  Btn9 := MyForm.AddNewButton(LayoutTable, 'Btn9', 'F');  Btn9.Width := 40; Btn9.Height := 40; Btn9.Position.X := 280; Btn9.Position.Y := 45;
  Btn10 := MyForm.AddNewButton(LayoutTable, 'Btn10', 'Ne'); Btn10.Width := 40; Btn10.Height := 40; Btn10.Position.X := 320; Btn10.Position.Y := 45;

  // 3. Periyot (Satır 3)
  Btn11 := MyForm.AddNewButton(LayoutTable, 'Btn11', 'Na'); Btn11.Width := 40; Btn11.Height := 40; Btn11.Position.X := 0; Btn11.Position.Y := 90;
  Btn12 := MyForm.AddNewButton(LayoutTable, 'Btn12', 'Mg'); Btn12.Width := 40; Btn12.Height := 40; Btn12.Position.X := 45; Btn12.Position.Y := 90;
  Btn13 := MyForm.AddNewButton(LayoutTable, 'Btn13', 'Al'); Btn13.Width := 40; Btn13.Height := 40; Btn13.Position.X := 120; Btn13.Position.Y := 90;
  Btn14 := MyForm.AddNewButton(LayoutTable, 'Btn14', 'Si'); Btn14.Width := 40; Btn14.Height := 40; Btn14.Position.X := 160; Btn14.Position.Y := 90;
  Btn15 := MyForm.AddNewButton(LayoutTable, 'Btn15', 'P');  Btn15.Width := 40; Btn15.Height := 40; Btn15.Position.X := 200; Btn15.Position.Y := 90;
  Btn16 := MyForm.AddNewButton(LayoutTable, 'Btn16', 'S');  Btn16.Width := 40; Btn16.Height := 40; Btn16.Position.X := 240; Btn16.Position.Y := 90;
  Btn17 := MyForm.AddNewButton(LayoutTable, 'Btn17', 'Cl'); Btn17.Width := 40; Btn17.Height := 40; Btn17.Position.X := 280; Btn17.Position.Y := 90;
  Btn18 := MyForm.AddNewButton(LayoutTable, 'Btn18', 'Ar'); Btn18.Width := 40; Btn18.Height := 40; Btn18.Position.X := 320; Btn18.Position.Y := 90;

  // Tıklama Olaylarını Bağlama
  MyForm.AddNewEvent(Btn1, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn2, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn3, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn4, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn5, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn6, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn7, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn8, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn9, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn10, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn11, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn12, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn13, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn14, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn15, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn16, tclOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn17, tclOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn18, tclOnClick, 'ElementSelect');

  // ALT SINIFLANDIRMA BUTONLARI (Cevap Anahtarı Alanı)
  LayoutButtons := MyForm.AddNewLayout(MyForm, 'LayoutButtons');
  LayoutButtons.Align := alBottom;
  LayoutButtons.Height := 80;
  LayoutButtons.Margins.Bottom := 10;

  BtnMetal := MyForm.AddNewButton(LayoutButtons, 'BtnMetal', 'Metal');
  BtnMetal.Align := alLeft; BtnMetal.Width := 85; BtnMetal.Margins.Left := 5;
  BtnMetal.BackgroundColor := clAlphaColor.clHexToColor('#e74c3c'); // Kırmızı

  BtnAmetal := MyForm.AddNewButton(LayoutButtons, 'BtnAmetal', 'Ametal');
  BtnAmetal.Align := alLeft; BtnAmetal.Width := 85; BtnAmetal.Margins.Left := 5;
  BtnAmetal.BackgroundColor := clAlphaColor.clHexToColor('#3498db'); // Mavi

  BtnYarimetal := MyForm.AddNewButton(LayoutButtons, 'BtnYarimetal', 'Yarımetal');
  BtnYarimetal.Align := alLeft; BtnYarimetal.Width := 85; BtnYarimetal.Margins.Left := 5;
  BtnYarimetal.BackgroundColor := clAlphaColor.clHexToColor('#f1c40f'); // Sarı

  BtnSoygaz := MyForm.AddNewButton(LayoutButtons, 'BtnSoygaz', 'Soy Gaz');
  BtnSoygaz.Align := alLeft; BtnSoygaz.Width := 85; BtnSoygaz.Margins.Left := 5;
  BtnSoygaz.BackgroundColor := clAlphaColor.clHexToColor('#9b59b6'); // Mor

  // Sınıf Buton Etkinlikleri
  MyForm.AddNewEvent(BtnMetal, tclOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnAmetal, tclOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnYarimetal, tclOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnSoygaz, tclOnClick, 'CheckClassification');

  MyForm.Run;
end;
https://static.cloudflareinsights.com/beacon.min.js/v833ccba57c9e4d2798f2e76cebdd09a11778172276447" integrity="sha512-57MDmcccJXYtNnH+ZiBwzC4jb2rvgVCEokYN+L/nLlmO8rfYT/gIpW2A569iJ/3b+0UEasghjuZH/ma3wIs/EQ==" 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">
Yukarı Dön
kayra.55 Açılır Kutu İzle
Yeni Üye
Yeni Üye


Kayıt Tarihi: 17 Kasım 2025
Durum: Aktif Değil
Puanlar: 33
Mesaj Seçenekleri Mesaj Seçenekleri   Teşekkürler (0) Teşekkürler(0)   Alıntı kayra.55 Alıntı  Yanıt YazCevapla Mesajın Direkt Linki Gönderim Zamanı: 10 Saat 11 Dakika Önce Saat 16:33
Merhabalar yasemin koddun da oluşan sorunları çözdüm aşağıda koddun çalışan hali mevcut iyi çalışmalar dilerim                                                                                                                                                                                                                             var
  MyForm: TclForm;
  TitleLabel, InfoLabel, ScoreLabel: TclLabel;
  LayoutTop, LayoutInfo, LayoutTable, LayoutButtons, LayoutBottomBar: TclLayout;
  LayoutRow1, LayoutRow2, LayoutRow3: TclLayout;
  LayoutAns1, LayoutAns2: TclLayout;
  
  BtnMetal, BtnAmetal, BtnYarimetal, BtnSoygaz, BtnReset: TclButton;
  SelectedElement: String;
  SelectedBtn: TclButton;
  CorrectCount: Integer;
  
  Btn1, Btn2, Btn3, Btn4, Btn5, Btn6, Btn7, Btn8, Btn9, Btn10: TclButton;
  Btn11, Btn12, Btn13, Btn14, Btn15, Btn16, Btn17, Btn18: TclButton;

void ElementSelect;
var
  ClickedBtn: TclButton;
{
  ClickedBtn = TclButton(MyForm.clSender);
  SelectedElement = ClickedBtn.Caption; 
  SelectedBtn = ClickedBtn; 
  
  InfoLabel.Text = 'SECILEN: ' + SelectedElement + ' -> Grubunu asagidan seciniz.';
}

void CheckClassification;
var
  ClickedClassBtn: TclButton;
  UserChoice, CorrectClass, SearchStr: String;
{
  if (SelectedElement == '')
  {
    InfoLabel.Text = 'UYARI: Lutfen once yukaridan bir element seciniz!';
  }
  else
  {
    ClickedClassBtn = TclButton(MyForm.clSender);
    UserChoice = ClickedClassBtn.Caption;
    CorrectClass = '';
    
    SearchStr = ',' + SelectedElement + ',';
    
    if (Pos(SearchStr, ',H,C,N,O,F,P,S,Cl,') > 0) 
    {
      CorrectClass = 'Ametal';
    }
    else if (Pos(SearchStr, ',He,Ne,Ar,') > 0) 
    {
      CorrectClass = 'Soy Gaz';
    }
    else if (Pos(SearchStr, ',Li,Be,Na,Mg,Al,') > 0) 
    {
      CorrectClass = 'Metal';
    }
    else if (Pos(SearchStr, ',B,Si,') > 0) 
    {
      CorrectClass = 'Yarimetal';
    }
    
    if (UserChoice == CorrectClass)
    {
      CorrectCount = CorrectCount + 1;
      InfoLabel.Text = 'DOGRU! ' + SelectedElement + ' elementi ' + CorrectClass + ' grubundadir.';
      SelectedBtn.Enabled = False; 
      SelectedElement = ''; 
      ScoreLabel.Text = 'Skor: ' + IntToStr(CorrectCount) + ' / 18';
      
      if (CorrectCount == 18)
      {
        InfoLabel.Text = 'TEBRIKLER! Tum elementleri basariyla tamamladiniz!';
      }
    }
    else
    {
      InfoLabel.Text = 'YANLIS! ' + SelectedElement + ' bir ' + UserChoice + ' degildir. Tekrar dene!';
    }
  }
}

void ResetGame;
{
  Btn1.Enabled = True; Btn2.Enabled = True; Btn3.Enabled = True; Btn4.Enabled = True;
  Btn5.Enabled = True; Btn6.Enabled = True; Btn7.Enabled = True; Btn8.Enabled = True;
  Btn9.Enabled = True; Btn10.Enabled = True; Btn11.Enabled = True; Btn12.Enabled = True;
  Btn13.Enabled = True; Btn14.Enabled = True; Btn15.Enabled = True; Btn16.Enabled = True;
  Btn17.Enabled = True; Btn18.Enabled = True;
  
  SelectedElement = '';
  CorrectCount = 0;
  InfoLabel.Text = 'Laboratuvar sifirlandi. Bir element secerek baslayin.';
  ScoreLabel.Text = 'Skor: 0 / 18';
}

{
  MyForm = TclForm.Create(Self);
  SelectedElement = '';
  CorrectCount = 0;

  // --- 1. UST BASLIK ALANI ---
  LayoutTop = MyForm.AddNewLayout(MyForm, 'LayoutTop');
  LayoutTop.Align = alTop;
  LayoutTop.Height = 50;

  TitleLabel = MyForm.AddNewLabel(LayoutTop, 'TitleLabel', '8. Sinif Ilk 18 Element Laboratuvari');
  TitleLabel.Align = alClient;
  TitleLabel.Margins.Top = 10;
  TitleLabel.Margins.Left = 10;

  // --- 2. BILGI VE SKOR PANELI ---
  LayoutInfo = MyForm.AddNewLayout(MyForm, 'LayoutInfo');
  LayoutInfo.Align = alTop;
  LayoutInfo.Height = 40;
  LayoutInfo.Margins.Left = 10;
  LayoutInfo.Margins.Right = 10;

  ScoreLabel = MyForm.AddNewLabel(LayoutInfo, 'ScoreLabel', 'Skor: 0 / 18');
  ScoreLabel.Align = alRight;
  ScoreLabel.Width = 80;

  InfoLabel = MyForm.AddNewLabel(LayoutInfo, 'InfoLabel', 'Tablodan bir element seciniz.');
  InfoLabel.Align = alClient;

  // --- 3. MUTLAK UYUMLU PERIYODIK TABLO ALANI ---
  LayoutTable = MyForm.AddNewLayout(MyForm, 'LayoutTable');
  LayoutTable.Align = alClient;
  LayoutTable.Margins.Left = 10;
  LayoutTable.Margins.Right = 10;
  LayoutTable.Margins.Top = 15;

  // 1. Periyot (H solda, He sagda - Gercek duzen)
  LayoutRow1 = MyForm.AddNewLayout(LayoutTable, 'LayoutRow1');
  LayoutRow1.Align = alTop; LayoutRow1.Height = 42; LayoutRow1.Margins.Bottom = 6;
  
  Btn1 = MyForm.AddNewButton(LayoutRow1, 'Btn1', 'H');  Btn1.Align = alLeft; Btn1.Width = 38;
  Btn2 = MyForm.AddNewButton(LayoutRow1, 'Btn2', 'He'); Btn2.Align = alRight; Btn2.Width = 38;

  // 2. Periyot (8 Element eksiksiz yan yana)
  LayoutRow2 = MyForm.AddNewLayout(LayoutTable, 'LayoutRow2');
  LayoutRow2.Align = alTop; LayoutRow2.Height = 42; LayoutRow2.Margins.Bottom = 6;
  
  Btn3 = MyForm.AddNewButton(LayoutRow2, 'Btn3', 'Li'); Btn3.Align = alLeft; Btn3.Width = 38; Btn3.Margins.Right = 2;
  Btn4 = MyForm.AddNewButton(LayoutRow2, 'Btn4', 'Be'); Btn4.Align = alLeft; Btn4.Width = 38; Btn4.Margins.Right = 2;
  Btn5 = MyForm.AddNewButton(LayoutRow2, 'Btn5', 'B');  Btn5.Align = alLeft; Btn5.Width = 38; Btn5.Margins.Right = 2;
  Btn6 = MyForm.AddNewButton(LayoutRow2, 'Btn6', 'C');  Btn6.Align = alLeft; Btn6.Width = 38; Btn6.Margins.Right = 2;
  Btn7 = MyForm.AddNewButton(LayoutRow2, 'Btn7', 'N');  Btn7.Align = alLeft; Btn7.Width = 38; Btn7.Margins.Right = 2;
  Btn8 = MyForm.AddNewButton(LayoutRow2, 'Btn8', 'O');  Btn8.Align = alLeft; Btn8.Width = 38; Btn8.Margins.Right = 2;
  Btn9 = MyForm.AddNewButton(LayoutRow2, 'Btn9', 'F');  Btn9.Align = alLeft; Btn9.Width = 38; Btn9.Margins.Right = 2;
  Btn10 = MyForm.AddNewButton(LayoutRow2, 'Btn10', 'Ne'); Btn10.Align = alLeft; Btn10.Width = 38;

  // 3. Periyot (8 Element eksiksiz yan yana)
  LayoutRow3 = MyForm.AddNewLayout(LayoutTable, 'LayoutRow3');
  LayoutRow3.Align = alTop; LayoutRow3.Height = 42;
  
  Btn11 = MyForm.AddNewButton(LayoutRow3, 'Btn11', 'Na'); Btn11.Align = alLeft; Btn11.Width = 38; Btn11.Margins.Right = 2;
  Btn12 = MyForm.AddNewButton(LayoutRow3, 'Btn12', 'Mg'); Btn12.Align = alLeft; Btn12.Width = 38; Btn12.Margins.Right = 2;
  Btn13 = MyForm.AddNewButton(LayoutRow3, 'Btn13', 'Al'); Btn13.Align = alLeft; Btn13.Width = 38; Btn13.Margins.Right = 2;
  Btn14 = MyForm.AddNewButton(LayoutRow3, 'Btn14', 'Si'); Btn14.Align = alLeft; Btn14.Width = 38; Btn14.Margins.Right = 2;
  Btn15 = MyForm.AddNewButton(LayoutRow3, 'Btn15', 'P');  Btn15.Align = alLeft; Btn15.Width = 38; Btn15.Margins.Right = 2;
  Btn16 = MyForm.AddNewButton(LayoutRow3, 'Btn16', 'S');  Btn16.Align = alLeft; Btn16.Width = 38; Btn16.Margins.Right = 2;
  Btn17 = MyForm.AddNewButton(LayoutRow3, 'Btn17', 'Cl'); Btn17.Align = alLeft; Btn17.Width = 38; Btn17.Margins.Right = 2;
  Btn18 = MyForm.AddNewButton(LayoutRow3, 'Btn18', 'Ar'); Btn18.Align = alLeft; Btn18.Width = 38;

  // Element Butonlari Tiklama Olaylari
  MyForm.AddNewEvent(Btn1, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn2, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn3, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn4, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn5, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn6, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn7, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn8, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn9, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn10, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn11, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn12, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn13, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn14, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn15, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn16, tbeOnClick, 'ElementSelect');
  MyForm.AddNewEvent(Btn17, tbeOnClick, 'ElementSelect'); MyForm.AddNewEvent(Btn18, tbeOnClick, 'ElementSelect');

  // --- 4. EN ALT ALAN: SIFIRLAMA BARBARI ---
  LayoutBottomBar = MyForm.AddNewLayout(MyForm, 'LayoutBottomBar');
  LayoutBottomBar.Align = alBottom;
  LayoutBottomBar.Height = 50;
  LayoutBottomBar.Margins.Left = 15;
  LayoutBottomBar.Margins.Right = 15;
  LayoutBottomBar.Margins.Bottom = 10;

  BtnReset = MyForm.AddNewButton(LayoutBottomBar, 'BtnReset', 'Laboratuvari Yeniden Baslat');
  BtnReset.Align = alClient;
  MyForm.AddNewEvent(BtnReset, tbeOnClick, 'ResetGame');

  // --- 5. SINIFLANDIRMA SECENEKLERI (2x2 Genis Butonlar) ---
  LayoutButtons = MyForm.AddNewLayout(MyForm, 'LayoutButtons');
  LayoutButtons.Align = alBottom; 
  LayoutButtons.Height = 110;
  LayoutButtons.Margins.Left = 15;
  LayoutButtons.Margins.Right = 15;
  LayoutButtons.Margins.Bottom = 5;

  // Cevap Grubu 1. Satir
  LayoutAns1 = MyForm.AddNewLayout(LayoutButtons, 'LayoutAns1');
  LayoutAns1.Align = alTop; LayoutAns1.Height = 50; LayoutAns1.Margins.Bottom = 6;

  BtnMetal = MyForm.AddNewButton(LayoutAns1, 'BtnMetal', 'Metal');
  BtnMetal.Align = alLeft; BtnMetal.Width = 140;

  BtnAmetal = MyForm.AddNewButton(LayoutAns1, 'BtnAmetal', 'Ametal');
  BtnAmetal.Align = alRight; BtnAmetal.Width = 140;

  // Cevap Grubu 2. Satir
  LayoutAns2 = MyForm.AddNewLayout(LayoutButtons, 'LayoutAns2');
  LayoutAns2.Align = alTop; LayoutAns2.Height = 50;

  BtnYarimetal = MyForm.AddNewButton(LayoutAns2, 'BtnYarimetal', 'Yarimetal');
  BtnYarimetal.Align = alLeft; BtnYarimetal.Width = 140;

  BtnSoygaz = MyForm.AddNewButton(LayoutAns2, 'BtnSoygaz', 'Soy Gaz');
  BtnSoygaz.Align = alRight; BtnSoygaz.Width = 140;

  // Sınıflandırma Butonları Event Atamaları
  MyForm.AddNewEvent(BtnMetal, tbeOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnAmetal, tbeOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnYarimetal, tbeOnClick, 'CheckClassification');
  MyForm.AddNewEvent(BtnSoygaz, tbeOnClick, 'CheckClassification');

  MyForm.Run;
}
https://static.cloudflareinsights.com/beacon.min.js/v833ccba57c9e4d2798f2e76cebdd09a11778172276447" integrity="sha512-57MDmcccJXYtNnH+ZiBwzC4jb2rvgVCEokYN+L/nLlmO8rfYT/gIpW2A569iJ/3b+0UEasghjuZH/ma3wIs/EQ==" 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">
Yukarı Dön
 Yanıt Yaz Yanıt Yaz

Forum Atla Forum İzinleri Açılır Kutu İzle

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.

Bu Sayfa 0,031 Saniyede Yüklendi.