Var Main_Page_Form : TclForm; AppBar_ProPanel, Footer_ProPanel : TclProPanel; Main_Page_ProButton, Profil_ProButton : TClProButton; Flow_ListView : TClProListView; DesignerPanel1 : TClProListViewDesignerPanel; haber_baslik, haber_icerik : TClProLabel; haber_Img : TclProImage; Myhttp : TclHttp; jsonResult : String;
void getClick; { jsonResult = Myhttp.GetRequest(' https://newsapi.org/v2/top-headlines?country=tr&category=general&apiKey=4c3254a99037421aa0655a048fac1f19" rel="nofollow - https://newsapi.org/v2/top-headlines?country=tr&category=general&apiKey=4c3254a99037421aa0655a048fac1f19 '); ShowMessage('API Yanıtı: ' + jsonResult); } void CreateDesignerPanel { DesignerPanel1 = Main_Page_Form.AddNewProListViewDesignerPanel(Flow_ListView, 'DesignerPanel1');
DesignerPanel1.Height = 580; DesignerPanel1.Width = 380; DesignerPanel1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#000000'); DesignerPanel1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#AA0E0E'); DesignerPanel1.clProSettings.BorderWidth = 2; DesignerPanel1.SetclProSettings(DesignerPanel1.clProSettings); Flow_ListView.SetDesignerPanel(DesignerPanel1); }
void CreateData; { haber_baslik = Main_Page_Form.AddNewProLabel(DesignerPanel1, 'haber_baslik', 'test'); haber_baslik.clProSettings.FontSize = 24; haber_baslik.clProSettings.TextSettings.Font.Style = [fsBold]; haber_baslik.clProSettings.FontColor = clAlphaColor.clHexToColor('#FFFFFF');
haber_baslik.Margins.Top = 5; haber_baslik.Margins.Left = 5; haber_baslik.Margins.Right = 5;
haber_baslik.Width = DesignerPanel1.Width - (haber_baslik.Margins.Left + haber_baslik.Margins.Right); haber_baslik.Align = alTop; haber_baslik.clProSettings.WordWrap = True; haber_baslik.clProSettings.AutoSize = True; haber_baslik.SetclProSettings(haber_baslik.clProSettings); DesignerPanel1.AddPanelObject(haber_baslik, clCaption);
haber_Img = Main_Page_Form.AddNewProImage(DesignerPanel1, 'haber_Img'); haber_Img.Align = alTop; haber_Img.Margins.Bottom = 10; haber_Img.Margins.Left = 5; haber_Img.Margins.Right = 5; haber_Img.Height = 500; haber_Img.Width = 500;
haber_Img.Width = DesignerPanel1.Width - (haber_Img.Margins.Left + haber_Img.Margins.Right);
haber_Img.clProSettings.PictureAutoFit = True; haber_Img.clProSettings.PictureStretch = True; haber_Img.SetclProSettings(haber_Img.clProSettings); DesignerPanel1.AddPanelObject(haber_Img, clImage1); } void AddDataToListView { Flow_ListView.clLoadProListViewDataFromDataset(Clomosy.ClDataSetFromJSON('[ {"haber_baslik" : "Orduda fındık toplama işçi ücreti bin 200 lira olarak belirlendi", "haber_Img" : " https://img.piri.net/piri/upload/3/2025/7/17/a8acf217-p0802dcjteasdz2lt3uk1l.jpeg" rel="nofollow - https://img.piri.net/piri/upload/3/2025/7/17/a8acf217-p0802dcjteasdz2lt3uk1l.jpeg" }, {"haber_baslik" : "İzmirde günlerdir suları kesik olan mahalle sakinleri kalıcı çözüm bekliyor", "haber_Img" : " https://img.piri.net/piri/upload/3/2025/7/17/87c4e0d3-dpcys46bz7wuskvos12xg.jpeg" rel="nofollow - https://img.piri.net/piri/upload/3/2025/7/17/87c4e0d3-dpcys46bz7wuskvos12xg.jpeg" },
{"haber_baslik" : "Tarım işçilerini taşıyan minibüs şarampole yuvarlandı: 2si ağır 17 yaralı", "haber_Img" : " https://img.piri.net/piri/upload/3/2025/7/17/aa57403d-n0p368vmi3as58a98e497.jpeg" rel="nofollow - https://img.piri.net/piri/upload/3/2025/7/17/aa57403d-n0p368vmi3as58a98e497.jpeg" } ]')); }
{ Main_Page_Form=TclForm.Create(self); Main_Page_Form.SetFormColor('#000000', '#000000', clGVertical); //APPBAR AppBar_ProPanel=Main_Page_Form.AddNewProPanel(Main_Page_Form,'AppBar_ProPanel'); AppBar_ProPanel.Align = alTop; AppBar_ProPanel.Height = 40; // AppBar_ProPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#000000'); AppBar_ProPanel.clProSettings.BackgroundColor = clAlphaColor.clHextoColor('#e90707');
// AppBar_ProPanel.clProSettings.RoundHeight = 10;
// AppBar_ProPanel.clProSettings.RoundWidth = 10;
// AppBar_ProPanel.clProSettings.BorderWidth = 2; // AppBar_ProPanel.clProSettings.IsFill = True; //AppBar_ProPanel.clProSettings.IsRound = True; AppBar_ProPanel.SetclProSettings(AppBar_ProPanel.clProSettings); // Footer Footer_ProPanel = Main_Page_Form.AddNewProPanel(Main_Page_Form,'Footer_ProPanel'); Footer_ProPanel.Align = alBottom; Footer_ProPanel.Height = 55; Footer_ProPanel.clProSettings.BackgroundColor = clAlphaColor.clHextoColor('#e90707'); Footer_ProPanel.SetclProSettings(Footer_ProPanel.clProSettings);
// Ana Sayfa Butonu
Main_Page_ProButton = Main_Page_Form.AddNewProButton(Footer_ProPanel, 'Main_Page_ProButton', 'Ana Sayfa');
Main_Page_ProButton.Align = alLeft; Main_Page_ProButton.clProSettings.FontColor = clAlphaColor.clHextoColor('#FFFFFF'); Main_Page_ProButton.clProSettings.FontSize = 18;
Main_Page_ProButton.SetClProSettings(Main_Page_ProButton.clProSettings); // Profil Butonu Profil_ProButton = Main_Page_Form.AddNewProButton(Footer_ProPanel, 'Profil_ProButton', 'Profil');
Profil_ProButton.Align = alRight; Profil_ProButton.clProSettings.FontColor = clAlphaColor.clHextoColor('#FFFFFF'); Profil_ProButton.clProSettings.FontSize = 18;
Profil_ProButton.SetClProSettings(Profil_ProButton.clProSettings);
// Haber Akışı İçin Listview Flow_ListView = Main_Page_Form.AddNewProListView(Main_Page_Form,'Flow_ListView');
Flow_ListView.Align = AlClient; Flow_ListView.clProSettings.ViewType = lvIcon; Flow_ListView.clProSettings.ColCount = 1; // tek sütun yani her satırda tek öge 2 sütun olsa 2 öge olur. Flow_ListView.clProSettings.ItemSpace = 5; // Flow_ListView.Margins.Bottom = 1; // Flow_ListView.Margins.Top = 1; // Flow_ListView.Margins.Right = 1; // Flow_ListView.Margins.Left = 1; // Flow_ListView.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FFFCFF'); // Flow_ListView.clProSettings.BorderColor = clAlphaColor.clHexToColor('#f6041c'); // Flow_ListView.clProSettings.BorderWidth = 5; // Flow_ListView.clProSettings.RoundHeight = 5; // Flow_ListView.clProSettings.RoundWidth = 5; Flow_ListView.clProSettings.ItemHeight = 700; // her bir öğenin boyutu // Flow_ListView.clProSettings.ItemSpace = 10;
CreateDesignerPanel; CreateData; AddDataToListView;
Flow_ListView.SetclProSettings(Flow_ListView.clProSettings); Myhttp = TclHttp.Create(Nil); getClick(); Main_Page_Form.Run; }
kodundaki sorunu çözmeye çalıştım ama çözemedim. Bu kodu inceleyebilirsin umarım yardımcı olur. Listview yapısı var ve çalışıyor.
|