Sayfayı Yazdır | Pencereyi Kapat

TclProListViewde hata

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=831
Tarih: 08 Ocak 2025 Saat 20:05
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: TclProListViewde hata
Mesajı Yazan: Furblood
Konu: TclProListViewde hata
Mesaj Tarihi: 07 Ağustos 2024 Saat 14:07
var
Myform : TclForm;
userPhoto,malePhoto1,malePhoto2,malePhoto3,femalePhoto1,femalePhoto2,femalePhoto3: TClProImage;
photoList : TCLProListView;
DesignerPanel : TClListViewDesignerPanel;
taskImg : TclProImage;
taskName : TClProLabel;



void CreateListView
{
  photoList = Myform.AddNewProListView(Myform,'photoList');
  photoList.Align = alRight;
  photoList.Margins.Bottom = 20;
  photoList.Margins.Top = 20;
  photoList.clProSettings.ViewType = lvIcon; //(lvList, lvIcon, lvWaterFall)
  photoList.clProSettings.ColCount = 1;
  photoList.clProSettings.ItemHeight = 100;
  photoList.clProSettings.ItemSpace = 10;
  photoList.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FFFCFF');
  photoList.clProSettings.BorderColor = clAlphaColor.clHexToColor('#66FF7F');
  photoList.clProSettings.BorderWidth = 2;
  photoList.clProSettings.RoundHeight = 5;
  photoList.clProSettings.RoundWidth = 5;
  photoList.SetclProSettings(photoList.clProSettings);
}

void CreateDesignerPanel
{
  DesignerPanel = Myform.AddNewProListViewDesignerPanel(photoList, 'DesignerPanel');
  DesignerPanel.Height = 100;
  DesignerPanel.Width = 100;
  DesignerPanel.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#B3FCE5');
  DesignerPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#16FF8C');
  DesignerPanel.clProSettings.BorderWidth = 2;
  DesignerPanel.clProSettings.RoundHeight = 20;
  DesignerPanel.clProSettings.RoundWidth = 20;
  DesignerPanel.SetclProSettings(DesignerPanel.clProSettings);
  
  photoList.SetDesignerPanel(DesignerPanel);
}

void CreateData;
{
  taskImg = Myform.AddNewProImage(DesignerPanel, 'taskImg');
  taskImg.Align = AlLeft;
  taskImg.Margins.Top = 10;
  taskImg.Margins.Bottom = 10;
  DesignerPanel.AddPanelObject(taskImg, clImage1);
  Myform.AddNewEvent(photoList,tbeOnItemClick,'TaskClick');
}

void AddDataToListView;
{
  photoList.clLoadProListViewDataFromDataset(Clomosy.ClDataSetFromJSON('[
  {"taskImg" : "https://i.imgur.com/m5V9b4x.png"},
  {"taskImg" : "https://i.imgur.com/LQ4J4dh.png"},
  {"taskImg" : "https://i.imgur.com/w9lmYul.png"},
  {"taskImg" : "https://i.imgur.com/b9jWqJK.png"},
  {"taskImg" : "https://i.imgur.com/KUMAPMj.png"},
  {"taskImg" : "https://i.imgur.com/4k2JH97.png"}
  ]'));
}

void listAyarla;
{
  CreateListView;
  CreateDesignerPanel;
  CreateData;
  AddDataToListview;
}

void TaskClick(item);
var 
  selectedPhotoUrl : string;
{
  selectedPhotoUrl = item.GetProImage('taskImg').clProSettings.PictureSource;
  userPhoto.clProSettings.PictureSource = selectedPhotoUrl;
  userPhoto.SetclProSettings(userPhoto.clProSettings);
  photoList.Visible = false;
}

{
MyForm = TclForm.Create(Self);

userPhoto = MyForm.AddNewProImage(MyForm,'userPhoto');
userPhoto.Align = alCenter;
userPhoto.Height = 100;
userPhoto.Margins.Bottom = 600;
userPhoto.Margins.Left = 200;
userPhoto.clProSettings.PictureSource = 'https://i.imgur.com/38uoXIt.png';
userPhoto.SetclProSettings(userPhoto.clProSettings);
MyForm.AddNewEvent(userPhoto,tbeOnClick,'listAyarla');


MyForm.Run;
}



Listviewdeki fotoğrafı seçtiğimde sayfadaki userPhoto resminin yerini almasını istiyorum fakat hata alıyorum.




-------------
furkanfidan



Cevaplar:
Mesajı Yazan: Developer
Mesaj Tarihi: 07 Ağustos 2024 Saat 14:42
Merhaba Furblood,
Aşağıdaki kodu inceler misin:
var
Myform : TclForm;
userPhoto,malePhoto1,malePhoto2,malePhoto3,femalePhoto1,femalePhoto2,femalePhoto3: TClProImage;
photoList : TCLProListView;
DesignerPanel : TClListViewDesignerPanel;
taskImg : TclProImage;
taskName : TClProLabel;



void CreateListView
{
  photoList = Myform.AddNewProListView(Myform,'photoList');
  photoList.Align = alRight;
  photoList.Margins.Bottom = 20;
  photoList.Margins.Top = 20;
  photoList.clProSettings.ViewType = lvIcon; //(lvList, lvIcon, lvWaterFall)
  photoList.clProSettings.ColCount = 1;
  photoList.clProSettings.ItemHeight = 100;
  photoList.clProSettings.ItemSpace = 10;
  photoList.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#FFFCFF');
  photoList.clProSettings.BorderColor = clAlphaColor.clHexToColor('#66FF7F');
  photoList.clProSettings.BorderWidth = 2;
  photoList.clProSettings.RoundHeight = 5;
  photoList.clProSettings.RoundWidth = 5;
  photoList.SetclProSettings(photoList.clProSettings);
  Myform.AddNewEvent(photoList,tbeOnItemClick,'TaskClick');
  photoList.Visible = false;
}

void CreateDesignerPanel
{
  DesignerPanel = Myform.AddNewProListViewDesignerPanel(photoList, 'DesignerPanel');
  DesignerPanel.Height = 100;
  DesignerPanel.Width = 100;
  DesignerPanel.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#B3FCE5');
  DesignerPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#16FF8C');
  DesignerPanel.clProSettings.BorderWidth = 2;
  DesignerPanel.clProSettings.RoundHeight = 20;
  DesignerPanel.clProSettings.RoundWidth = 20;
  DesignerPanel.SetclProSettings(DesignerPanel.clProSettings);
  
}

void CreateData;
{
  taskImg = Myform.AddNewProImage(DesignerPanel, 'taskImg');
  taskImg.Align = AlLeft;
  taskImg.Margins.Top = 10;
  taskImg.Margins.Bottom = 10;
  DesignerPanel.AddPanelObject(taskImg, clText2);
  photoList.SetDesignerPanel(DesignerPanel);
}

void AddDataToListView;
{
  photoList.clLoadProListViewDataFromDataset(Clomosy.ClDataSetFromJSON('
  {"taskImg" : " https://i.imgur.com/m5V9b4x.png" rel="nofollow - https://i.imgur.com/m5V9b4x.png" },
  {"taskImg" : " https://i.imgur.com/LQ4J4dh.png" rel="nofollow - https://i.imgur.com/LQ4J4dh.png" },
  {"taskImg" : " https://i.imgur.com/w9lmYul.png" rel="nofollow - https://i.imgur.com/w9lmYul.png" },
  {"taskImg" : " https://i.imgur.com/b9jWqJK.png" rel="nofollow - https://i.imgur.com/b9jWqJK.png" },
  {"taskImg" : " https://i.imgur.com/KUMAPMj.png" rel="nofollow - https://i.imgur.com/KUMAPMj.png" },
  {"taskImg" : " https://i.imgur.com/4k2JH97.png" rel="nofollow - https://i.imgur.com/4k2JH97.png" }
  '));
}

void listAyarla;
{
  
  AddDataToListview;
  photoList.Visible = not photoList.Visible;
}

void TaskClick(item);
var 
  selectedPhotoUrl : string;
{
  selectedPhotoUrl = photoList.clSelectedItemData(clText2);
  userPhoto.clProSettings.PictureSource = selectedPhotoUrl;
  userPhoto.SetclProSettings(userPhoto.clProSettings);
  photoList.Visible = false;
}

{
MyForm = TclForm.Create(Self);


userPhoto = MyForm.AddNewProImage(MyForm,'userPhoto');
userPhoto.Align = alCenter;
userPhoto.Height = 100;
userPhoto.Margins.Bottom = 600;
userPhoto.Margins.Left = 200;
userPhoto.clProSettings.PictureSource = ' https://i.imgur.com/38uoXIt.png" rel="nofollow - https://i.imgur.com/38uoXIt.png ';
userPhoto.SetclProSettings(userPhoto.clProSettings);

CreateListView;
CreateDesignerPanel;
CreateData;

MyForm.AddNewEvent(userPhoto,tbeOnClick,'listAyarla');


MyForm.Run;
}



Mesajı Yazan: Furblood
Mesaj Tarihi: 07 Ağustos 2024 Saat 14:47
Çalıştı, çok teşekkürler.

-------------
furkanfidan



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