Sayfayı Yazdır | Pencereyi Kapat

Listview

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Genel İşlemler
Forum Tanımlaması: TRObject dili ile programlama yaparken karşılaşılan genel işlemler
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=656
Tarih: 06 Ocak 2025 Saat 12:51
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: Listview
Mesajı Yazan: bekirr
Konu: Listview
Mesaj Tarihi: 11 Temmuz 2024 Saat 18:14
Listviewe nasıl fotoğraf ekleyebilirim



Cevaplar:
Mesajı Yazan: Developer
Mesaj Tarihi: 12 Temmuz 2024 Saat 10:44
Merhaba Bekir 
Aşağıda yer alan kodları inceler misin :

Var  

  MyForm:TclForm;

  testListView : TClProListView;

  testDesignerPanel : TClListViewDesignerPanel;

  productName : TclProLabel;

  approveImg, rejectImg : TclProImage;

 

void ApproveClick;

{

  ShowMessage('Tag: ' + TclProListView(Myform.Clsender).ClTagInt + ' Item: ' + testListView.clSelectedItemData(clText));

}

 

void RejectClick;

{

  ShowMessage('Kullanıcı Reddedildi!');

}

 

 

void CreateListView

{

  testListView = MyForm.AddNewProListView(MyForm,'testListView');

  testListView.Properties.ItemSpace = 10;    

  

  clComponent.SetupComponent(testListview,

  '{"Height" : 150,

  "Align":"Client",

  "MarginBottom":20,

  "MarginTop":20,

  "MarginRight":20,

  "MarginLeft":20,

  "ListType":"Cart",  

  "ItemColumnCount" : 1,

  "ItemHeight" : 150,

  "BackgroundColor":"#FFFCFF",

  "BorderColor":"#66FF7F",

  "BorderWidth":2,

  "RoundWidth":5,

  "RoundHeight":5}');

}

 

 

 

void CreateDesignerPanel

{

  testDesignerPanel = MyForm.AddNewProListViewDesignerPanel(testListView, 'testDesignerPanel');

 

  clComponent.SetupComponent(testDesignerPanel,

  '{"Height":100,

    "Width" : 150,

    "BackgroundColor":"#B3FCE5",

    "BorderColor":"#16FF8C",

    "BorderWidth":2,

    "RoundHeight":20,

    "RoundWidth":20}');

   

    testListView.SetDesignerPanel(testDesignerPanel);

}

 

void CreateData;

{

 

  productName = MyForm.AddNewProLabel(testDesignerPanel, 'productName', 'test');

  clComponent.SetupComponent(productName,

  '{"MarginTop" : 10,

    "MarginLeft" : 10,

    "MarginRight" : 10,

    "MarginBottom" : 10,

    "Height" : 30,

    "TextSize" : 20,

    "TextColor" : "#000000",

    "Align" : "VertCenter"}');

   

  // Adding productName as caption

  testDesignerPanel.AddPanelObject(productName, clText);

   

    

 

 

  approveImg = MyForm.AddNewProImage(testDesignerPanel, 'approveImg');

  clComponent.SetupComponent(approveImg,'{"Align":"Right", "MarginTop":30, "MarginBottom":30}');

  approveImg.clTagInt = 0;

 

  rejectImg = MyForm.AddNewProImage(testDesignerPanel, 'rejectImg');

  clComponent.SetupComponent(rejectImg,'{"Align":"Right", "MarginTop":15, "MarginBottom":15}');

  rejectImg.clTagInt = 1;

 

  testListView.clTagInt = 3;

  MyForm.AddNewEvent(testListView,tbeOnItemClick,'ApproveClick');

  MyForm.AddNewEvent(rejectImg,tbeOnClick,'RejectClick');

 

  testDesignerPanel.AddPanelObject(approveImg, clImage1);

  testDesignerPanel.AddPanelObject(rejectImg, clImage2);

}

 

void AddDataToListView;

{

  testListView.clLoadProListViewDataFromDataset(Clomosy.ClDataSetFromJSON('[

  {"productName" : "User 1", "approveImg" : " https://cdn-icons-png.flaticon.com/512/4315/4315445.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/4315/4315445.png ", "rejectImg" : " https://cdn-icons-png.flaticon.com/512/10621/10621089.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/10621/10621089.png "},

  {"productName" : "User 2", "approveImg" : " https://cdn-icons-png.flaticon.com/512/4315/4315445.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/4315/4315445.png ", "rejectImg" : " https://cdn-icons-png.flaticon.com/512/10621/10621089.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/10621/10621089.png "},

  {"productName" : "User 3", "approveImg" : " https://cdn-icons-png.flaticon.com/512/4315/4315445.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/4315/4315445.png ", "rejectImg" : " https://cdn-icons-png.flaticon.com/512/10621/10621089.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/10621/10621089.png "},

  {"productName" : "User 4", "approveImg" : " https://cdn-icons-png.flaticon.com/512/4315/4315445.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/4315/4315445.png ", "rejectImg" : " https://cdn-icons-png.flaticon.com/512/10621/10621089.png" rel="nofollow - https://cdn-icons-png.flaticon.com/512/10621/10621089.png "}

  ]'));

}

 

{

  MyForm = TclForm.Create(Self);

  CreateListView;

  CreateDesignerPanel;

  CreateData;

  AddDataToListview;

  MyForm.Run;

}




Mesajı Yazan: bekirr
Mesaj Tarihi: 12 Temmuz 2024 Saat 14:58
Teşekkür Ederim



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net