var IlanForm: TclForm; IlansearchEdit: TclProSearchEdit; IlansearchPanel, TopPanel, HorzPanel: TclProPanel; CategoryScrollBox: TclHorzScrollBox; ButtonPanel: TclProPanel; CategoryButton: TclProButton; CategoryLabel: TclProLabel; counter: Integer; ImageURLs: array[0..11] of string; CategoryNames: array[0..11] of string; IlanListView : TClProListView; IlanDesignerPanel : TClProListViewDesignerPanel; IlanPicture,IlanYildizImg : TclProImage; IlanName,IlanKonum,IlanPrice,IlanTarih,IlanYildiz,IlanPuan,IlanLabelGece : TclProLabel; IlanQuery: TClSqlQuery;
void CreateIlanListView; { IlanListView = IlanForm.AddNewProListView(IlanForm, 'IlanListView'); IlanListView.Height = IlanForm.clHeight - TopPanel.Height - HorzPanel.Height; IlanListView.Width = 200; IlanListView.Align = alClient; IlanListView.clProSettings.BorderColor = clAlphaColor.clHexToColor('#070807'); IlanListView.ListType = 'Cart'; IlanListView.clProSettings.ItemSpace = 50; IlanListView.clProSettings.ItemHeight = 300; IlanListView.clProSettings.BorderWidth = 1; IlanListView.SetclProSettings(IlanListView.clProSettings); IlansearchEdit.TargetListView = IlanListView; }
void CreateListDesignerPanel; { IlanDesignerPanel = IlanForm.AddNewProListViewDesignerPanel(IlanListView, 'IlanDesignerPanel'); IlanDesignerPanel.Align = alClient; IlanDesignerPanel.Height = 300; IlanDesignerPanel.Width = 70; IlanDesignerPanel.Margins.Top = 10; IlanDesignerPanel.Margins.Bottom = 10; IlanDesignerPanel.Margins.Right = 10; IlanDesignerPanel.Margins.Left = 10; IlanDesignerPanel.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#5AB2FF'); IlanDesignerPanel.clProSettings.RoundHeight = 10; IlanDesignerPanel.clProSettings.RoundWidth = 10; IlanListView.SetDesignerPanel(IlanDesignerPanel); IlanDesignerPanel.SetclProSettings(IlanDesignerPanel.clProSettings); }
void ResimEkle; { IlanPicture = IlanForm.AddNewProImage(IlanDesignerPanel, 'IlanPicture'); IlanDesignerPanel.AddPanelObject(IlanPicture, clImage1); IlanPicture.Align = alCenter; IlanPicture.Width = 300; IlanPicture.Height = 200; IlanPicture.clProSettings.PictureAutoFit = True; IlanPicture.clProSettings.PictureStretch = True; IlanPicture.SetclProSettings(IlanPicture.clProSettings); }
void KonumEkle; { IlanKonum = IlanForm.AddNewProLabel(IlanDesignerPanel, 'IlanKonum', 'Konum'); IlanDesignerPanel.AddPanelObject(IlanKonum, clText); IlanKonum.Align = alBottom; IlanKonum.Properties.AutoSize = True; IlanKonum.clProSettings.FontSize = 12; IlanKonum.SetclProSettings(IlanKonum.clProSettings); }
void TarihEkle; { IlanTarih = IlanForm.AddNewProLabel(IlanDesignerPanel, 'IlanTarih', 'Tarih'); IlanDesignerPanel.AddPanelObject(IlanTarih, clText1); IlanTarih.Align = alBottom; IlanTarih.Properties.AutoSize = True; IlanTarih.clProSettings.FontSize = 12; IlanTarih.SetclProSettings(IlanTarih.clProSettings); }
void FiyatEkle; { IlanPrice = IlanForm.AddNewProLabel(IlanDesignerPanel, 'IlanPrice', 'Fiyat'); IlanDesignerPanel.AddPanelObject(IlanPrice, clText2); IlanPrice.Align = alBottom; IlanPrice.Properties.AutoSize = True; IlanPrice.clProSettings.FontSize = 12; IlanPrice.clProSettings.TextSettings.Font.Style = [fsBold]; IlanPrice.SetclProSettings(IlanPrice.clProSettings); }
void YildizImgEkle; { IlanYildizImg = IlanForm.AddNewProImage(IlanDesignerPanel, 'IlanYildizImg'); IlanDesignerPanel.AddPanelObject(IlanYildizImg, clImage2); IlanYildizImg.Align = alRight; IlanYildizImg.Height = 30; IlanYildizImg.Width = 30; IlanYildizImg.clProSettings.PictureAutoFit = True; IlanYildizImg.clProSettings.PictureStretch = True; IlanYildizImg.clProSettings.PictureSource = ' https://i.imgur.com/sfqqu3E.png" rel="nofollow - https://i.imgur.com/sfqqu3E.png '; IlanYildizImg.SetclProSettings(IlanYildizImg.clProSettings); }
void YildizEkle; { IlanYildiz = IlanForm.AddNewProLabel(IlanDesignerPanel, 'IlanYildiz', 'Yıldız'); IlanDesignerPanel.AddPanelObject(IlanYildiz, clText3); IlanYildiz.Align = alRight; IlanYildiz.Properties.AutoSize = True; IlanYildiz.clProSettings.FontSize = 12; IlanYildiz.SetclProSettings(IlanYildiz.clProSettings); }
void LoadIlanlarFromDatabase(CategoryFilter: string); { try IlanQuery.Connection = Clomosy.DBSQLServerConnection; if (CategoryFilter == '') { IlanQuery.SQL.Text = 'SELECT Adres as FOOTER_TEXT, Konum as FOOTER_TEXT, Tarih as FOOTER_TEXT, Fiyat as FOOTER_TEXT, Puan as FOOTER_TEXT FROM Ilanlar'; } else { IlanQuery.SQL.Text = 'SELECT Adres as FOOTER_TEXT, Konum as FOOTER_TEXT, Tarih as FOOTER_TEXT, Fiyat as FOOTER_TEXT, Puan as FOOTER_TEXT * FROM Ilanlar WHERE Kategori = ' + QuotedStr(CategoryFilter); } IlanQuery.Open; if (IlanQuery.Found) { IlanListView.ClLoadProListViewDataFromDataset(IlanQuery); } else { ShowMessage('Kayıt Bulunamadı!'); } finally IlanQuery.Close; IlanQuery.Free; } } /* void CategoryButtonClick(Sender: TObject); { LoadIlanlarFromDatabase(IntToStr(TClProButton(Sender))); } */ { IlanForm = TclForm.Create(Self); IlanQuery = TClSqlQuery.Create(nil); Clomosy.DBSQLServerConnect('SQL Server', '172.16.222.176', 'SA', 'reallyStrongPwd123', 'Clomosy', 1433);
TopPanel = IlanForm.AddNewProPanel(IlanForm, 'TopPanel'); TopPanel.Align = alTop; TopPanel.Height = 150; TopPanel.Width = 300; TopPanel.Margins.Top = 10; TopPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#070807'); TopPanel.clProSettings.BorderWidth = 1; TopPanel.clProSettings.IsTransparent = True; TopPanel.SetclProSettings(TopPanel.clProSettings);
// Arama Paneli oluşturma IlansearchPanel = IlanForm.AddNewProPanel(TopPanel, 'IlansearchPanel'); IlansearchPanel.Align = alTop; IlansearchPanel.Height = 60; IlansearchPanel.Width = 300; IlansearchPanel.Margins.Left = 20; IlansearchPanel.Margins.Right = 20; IlansearchPanel.Margins.Top = 10; IlansearchPanel.clProSettings.RoundHeight = 30; IlansearchPanel.clProSettings.RoundWidth = 30; IlansearchPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#070807'); IlansearchPanel.clProSettings.BorderWidth = 1; IlansearchPanel.clProSettings.IsTransparent = True; IlansearchPanel.SetclProSettings(IlansearchPanel.clProSettings);
// Arama Edit alanı oluşturma IlansearchEdit = IlanForm.AddNewProSearchEdit(IlansearchPanel, 'IlansearchEdit', 'Nereye gitmek istiyorsunuz?'); IlansearchEdit.Align = alClient; IlansearchEdit.Margins.Top = 15; IlansearchEdit.Margins.Left = 15; IlansearchEdit.Margins.Right = 15; IlansearchEdit.Margins.Bottom = 10; IlansearchEdit.Height = 35; IlansearchEdit.SetclProSettings(IlansearchEdit.clProSettings);
HorzPanel = IlanForm.AddNewProPanel(TopPanel, 'HorzPanel'); HorzPanel.Align = alTop; HorzPanel.Height = 80; // Yüksekliği arttırarak buton ve etiket için alan bırakıyoruz HorzPanel.Width = 70; HorzPanel.Margins.Top = 10; HorzPanel.clProSettings.IsTransparent = True; HorzPanel.SetclProSettings(HorzPanel.clProSettings);
// HorizontalScrollBox oluşturma CategoryScrollBox = IlanForm.AddNewHorzScrollBox(HorzPanel, 'CategoryScrollBox'); CategoryScrollBox.Align = alClient; CategoryScrollBox.Height = 100; // Yüksekliği arttırarak butonun altına label eklemek için alan bırakıyoruz CategoryScrollBox.Width = 300;
// Resim URL'lerinin ve Kategori İsimlerinin tanımlanması ImageURLs[0] = ' https://i.imgur.com/rQOm9Uv.png" rel="nofollow - https://i.imgur.com/rQOm9Uv.png '; ImageURLs[1] = ' https://i.imgur.com/mOSXbt0.png" rel="nofollow - https://i.imgur.com/mOSXbt0.png '; ImageURLs[2] = ' https://i.imgur.com/i1YL3D3.png" rel="nofollow - https://i.imgur.com/i1YL3D3.png '; ImageURLs[3] = ' https://i.imgur.com/XGpNyoc.png" rel="nofollow - https://i.imgur.com/XGpNyoc.png '; ImageURLs[4] = ' https://i.imgur.com/rrL8Yhn.png" rel="nofollow - https://i.imgur.com/rrL8Yhn.png '; ImageURLs[5] = ' https://i.imgur.com/C2wBjUE.png" rel="nofollow - https://i.imgur.com/C2wBjUE.png '; ImageURLs[6] = ' https://i.imgur.com/bkxANR8.png" rel="nofollow - https://i.imgur.com/bkxANR8.png '; ImageURLs[7] = ' https://i.imgur.com/QZ8vfPg.png" rel="nofollow - https://i.imgur.com/QZ8vfPg.png '; ImageURLs[8] = ' https://i.imgur.com/PSbHzMr.png" rel="nofollow - https://i.imgur.com/PSbHzMr.png '; ImageURLs[9] = ' https://i.imgur.com/0Otuk1o.png" rel="nofollow - https://i.imgur.com/0Otuk1o.png '; ImageURLs[10] = ' https://i.imgur.com/FY0fFLU.png" rel="nofollow - https://i.imgur.com/FY0fFLU.png '; ImageURLs[11] = ' https://i.imgur.com/jMvyQaW.png" rel="nofollow - https://i.imgur.com/jMvyQaW.png ';
CategoryNames[0] = 'Efsaneler'; CategoryNames[1] = 'Muhteşem havuzlar'; CategoryNames[2] = 'Denize sıfır'; CategoryNames[3] = 'Üçgen evler'; CategoryNames[4] = 'Tasarım'; CategoryNames[5] = 'Kırsal'; CategoryNames[6] = 'Güzel manzaralar'; CategoryNames[7] = 'Küçük evler'; CategoryNames[8] = 'Tekneler'; CategoryNames[9] = 'Şatolar'; CategoryNames[10] = 'Göl yakınında'; CategoryNames[11] = 'Olağanüstü';
for counter = 0 to 11 { // Panel oluşturma ButtonPanel = IlanForm.AddNewProPanel(CategoryScrollBox, 'ButtonPanel' + IntToStr(counter)); ButtonPanel.Align = alLeft; ButtonPanel.Margins.Right = 5; ButtonPanel.Margins.Top = 2; ButtonPanel.Margins.Bottom = 2; ButtonPanel.Width = 90; ButtonPanel.Height = 180; ButtonPanel.clProSettings.IsTransparent = True; ButtonPanel.SetclProSettings(ButtonPanel.clProSettings);
// Buton oluşturma CategoryButton = IlanForm.AddNewProButton(ButtonPanel, 'CategoryButton' + IntToStr(counter), ''); CategoryButton.Align = alTop; CategoryButton.Width = 38; CategoryButton.Height = 38; CategoryButton.clProSettings.PictureSource = ImageURLs[counter]; CategoryButton.clProSettings.PictureAutoFit = True; CategoryButton.clProSettings.PictureStretch = False; CategoryButton.clProSettings.IsTransparent = True; CategoryButton.Padding.Top = 30; CategoryButton.Padding.Right = 30; CategoryButton.Padding.Bottom = 30; CategoryButton.Padding.Left = 30; CategoryButton.Hint = CategoryNames[counter]; CategoryButton.SetclProSettings(CategoryButton.clProSettings); IlanForm.AddNewEvent(CategoryButton, tbeOnClick, 'CategoryButtonClick');
// Label oluşturma CategoryLabel = IlanForm.AddNewProLabel(ButtonPanel, 'CategoryLabel' + IntToStr(counter), CategoryNames[counter]); CategoryLabel.Align = alBottom; CategoryLabel.Margins.Top = 20; CategoryLabel.Margins.Bottom = 10; CategoryLabel.Width = 100; CategoryLabel.Height = 20; CategoryLabel.clProSettings.FontSize = 10; CategoryLabel.clProSettings.IsTransparent = True; CategoryLabel.clProSettings.FontHorzAlign = palCenter; CategoryLabel.Padding.Top = 2; // Üst padding CategoryLabel.Padding.Right = 2; // Sağ padding CategoryLabel.Padding.Bottom = 2; // Alt padding CategoryLabel.Padding.Left = 2; // Sol padding CategoryLabel.SetclProSettings(CategoryLabel.clProSettings); }
CreateIlanListView; CreateListDesignerPanel; ResimEkle; KonumEkle; TarihEkle; FiyatEkle; YildizImgEkle; YildizEkle; LoadIlanlarFromDatabase('');
// Formu çalıştırma IlanForm.Run; }
|