Sayfayı Yazdır | Pencereyi Kapat

TclProListView içinde panel kullanımı

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=746
Tarih: 23 Ocak 2025 Saat 16:06
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: TclProListView içinde panel kullanımı
Mesajı Yazan: Osman
Konu: TclProListView içinde panel kullanımı
Mesaj Tarihi: 25 Temmuz 2024 Saat 15:07
uploads/206/Screenshot_6.png" rel="nofollow - uploads/206/Screenshot_6.png

listviiewda TClProListViewDesignerPanel kullanıyorum bun şekildeyken 
borsaListesi.clLoadProListViewDataFromDataset(Clomosy.ClDataSetFromJSON('[
  {"ad" : "A1 CAPITAL YATIRIM", "kod" : "A1CAP","yuzdedegisim":-1.52},
  {"ad" : "ALARKO HOLDING", "kod" : "ALARK","yuzdedegisim":2},
  {"ad" : "CIMENTAS", "kod" : "CMENT","yuzdedegisim":-1.52},
  {"ad" : "OBA MAKARNACILIK", "kod" : "OBAMS","yuzdedegisim":-1.52},
  {"ad" : "TURK HAVA YOLLARI", "kod" : "THYAO","yuzdedegisim":-1.52},
  {"ad" : "TAT GIDA", "kod" : "TATGD","yuzdedegisim":-1.52},
  {"ad" : "QNB FINANSBANK", "kod" : "QNBFB","yuzdedegisim":-1.52}
  ]'));
veri atarsam veriler listview'a geliyor fakat listviewın içerisinde başka bir panel daha eklersem ve onu 
 listDesignerPanel.AddPanelObject(sagPanel, clText1);
eklersem o panelin içersine datalar gelmiyor.



Cevaplar:
Mesajı Yazan: Developer
Mesaj Tarihi: 25 Temmuz 2024 Saat 16:06
Merhaba Osman,
Çalışmalarımız devam ediyor Panel de kullanılan verilere erişme noktasında.
Aşağıdaki kodu inceler misin?
var
MyForm: TclForm;
AddBtn,BackBtn,RefreshButton: TClProButton;
MainLyt,BtnLyt,TopBtnLyt,ListLyt,BodyLyt : TClLayout;
MainPanelHeight,MainPanelWidth: Integer;
MainPnl,SearchPanel:TclProPanel;
TitleLabel,MAIN_TEXT,SIDE_TEXT_TOP,SUB_TEXT,FOOTER_TEXT : TClProLabel;
InterviewListview : TClListView;
testListview : TClProListView;
ProImage : TClProImage;
testDesignerPanel : TClProListViewDesignerPanel;
proSearchEdt1 : TClProSearchEdit;

procedure AddDataToListview2;
 Var
   ListQuery : TClSqlQuery;
 begin
   ListQuery := TClSqlQuery.Create(nil);
   try
     ListQuery.Connection := Clomosy.DBSQLServerConnection;
     ListQuery.SQL.Text := 'Exec GetGorusmeler';
     ListQuery.Open;
     if ListQuery.Found then
     begin
        testListview.clLoadProListViewDataFromDataset(ListQuery);
     end;
   finally
     ListQuery.Free;
   end;
 end;
 
procedure UpdateRecord;
begin
 Clomosy.GlobalVariableInteger := StrToInt(testListview.clSelectedItemData(clRecord_GUID));
 Clomosy.runUnit('uUpdatePage');
 
end;
 
procedure AddPageRoute;
begin
 Clomosy.runUnit('uAddPage');
end;
procedure closeButtonClick;
begin
  clDoClick(TclButton(MyForm.clFindComponent('BtnGoBack')));
end;
procedure MainPanelSet;
begin
  MainLyt := MyForm.AddNewLayout(MyForm,'MainLyt');
  MainLyt.Align:=alContents;
  
  MainPanelHeight :=(MainLyt.Height)*0.96; 
  MainPanelWidth := (MainLyt.Height)*0.96 ;
  
  MainPnl := MyForm.AddNewProPanel(MainLyt, 'MainPnl');
  clComponent.SetupComponent(MainPnl,'{"Align" : "Client",
  "Height":'+IntToStr(mainPanelHeight)+',
  "BackgroundColor":"#ffffff", 
  "BorderColor":"null",
  "MarginTop" : 8,
  "MarginBottom":32,
  "MarginRight":10,
  "MarginLeft":10, 
  "RoundHeight":10,
  "RoundWidth":10,
  "BorderWidth":1}');
end;
procedure ButtonSet;
begin
  TopBtnLyt := MyForm.AddNewLayout(MainPnl,'TopBtnLyt');
  TopBtnLyt.Align := alMostTop;
  TopBtnLyt.Height := 56;
  
  BackBtn := MyForm.AddNewProButton(TopBtnLyt,'BackBtn','ÇIKIŞ');
  clComponent.SetupComponent(BackBtn,'{"Align" : "Left"
  ,"TextSize":16
  ,"TextBold":"yes"
  ,"BackgroundColor":"#e00000"
  ,"RoundWidht":8
  ,"RoundHeight":8
  ,"TextColor":"#ffffff"
  ,"MarginTop":16
  ,"Width" :80
  ,"MarginLeft":12
  }');
  MyForm.AddNewEvent(BackBtn,tbeOnClick,'closeButtonClick');
   
  BtnLyt := MyForm.AddNewLayout(MainPnl,'BtnLyt');
  BtnLyt.Align := alMostBottom;
  BtnLyt.Height := 56;
  BtnLyt.Margins.Top := 12;
  
 
  AddBtn := MyForm.AddNewProButton(BtnLyt,'AddBtn','EKLE');
  clComponent.SetupComponent(AddBtn,'{"Align" : "Right"
  ,"TextSize":16
  ,"TextBold":"yes"
  ,"BackgroundColor":"#002aff"
  ,"RoundWidht":8
  ,"RoundHeight":8
  ,"TextColor":"#ffffff"
  ,"MarginBottom":16
  ,"Width" :80
  ,"MarginRight":22
  }');
  MyForm.AddNewEvent(AddBtn,tbeOnClick,'AddPageRoute');
  
  RefreshButton := MyForm.AddNewProButton(BtnLyt,'RefreshButton','YENİLE');
  clComponent.SetupComponent(RefreshButton,'{"Align" : "Right"
  ,"TextSize":16
  ,"TextBold":"yes"
  ,"BackgroundColor":"#00b282"
  ,"RoundWidht":8
  ,"RoundHeight":8
  ,"TextColor":"#ffffff"
  ,"MarginBottom":16
  ,"Width" :80
  ,"MarginRight":22
  }');
  MyForm.AddNewEvent(RefreshButton,tbeOnClick,'AddDataToListview2');
end;

 procedure CreateDesignerPanel;
 begin
   testDesignerPanel := MyForm.AddNewProListViewDesignerPanel(testListview,'testDesignerPanel'); 
   clComponent.SetupComponent(testDesignerPanel,'{"Height":100,"Width" : 150,"BackgroundColor":"#ffffff","BorderColor":"#787878","BorderWidth":1,"RoundHeight":6,"RoundWidth":6}');
   testListview.SetDesignerPanel(testDesignerPanel);
   MyForm.AddNewEvent(testListview,tbeOnItemClick,'UpdateRecord');

 end;
 
 procedure CreateListView;
 begin
   ListLyt := MyForm.AddNewLayout(MainPnl,'ListLyt');
   ListLyt.Align := alClient ;
 
   testListview := MyForm.AddNewProListView(ListLyt,'testListview');
   testListview.Properties.ItemSpace := 8;
   clComponent.SetupComponent(testListview,'{"Height" : 100,"Align":"Client", "ListType":"Cart","ItemColumnCount" : 1,"ItemHeight" : 120,"ItemWidth":360, 
   "BorderColor":"#ffffff", "BorderWidth":2,"RoundWidth":5, "RoundHeight":5}');
   testListview.ListType := 'vertical';
   
   proSearchEdt1.TargetListView := testListview;
 end;
 
 procedure CreateProductNameAndPrice;
 var
 image_lyt,main_lyt,card_lyt : TClLayout;
 begin
  
    main_lyt := MyForm.AddNewLayout(testDesignerPanel,'main_lyt');
    main_lyt.Align := alCenter;
  
    MAIN_TEXT := MyForm.AddNewProLabel(main_lyt,'MAIN_TEXT','Hello World');
    clComponent.SetupComponent(MAIN_TEXT,'{"Align" : "Top","TextSize":14,"TextBold":"yes","MarginTop":6,"MarginLeft":6}');
    testDesignerPanel.AddPanelObject(MAIN_TEXT,clText);
    
    FOOTER_TEXT := MyForm.AddNewProLabel(main_lyt,'FOOTER_TEXT','Hello World');
    clComponent.SetupComponent(FOOTER_TEXT,'{"Align" : "Bottom","TextSize":14,"TextBold":"no","MarginTop":6,"MarginLeft":6}');
    testDesignerPanel.AddPanelObject(FOOTER_TEXT,clText2);
    
    SIDE_TEXT_TOP := MyForm.AddNewProLabel(main_lyt,'SIDE_TEXT_TOP','Hello World');
    clComponent.SetupComponent(SIDE_TEXT_TOP,'{"Align" : "Bottom","TextSize":14,"TextBold":"no","MarginTop":6,"MarginLeft":6}');
    testDesignerPanel.AddPanelObject(SIDE_TEXT_TOP,clText3);
    
    SUB_TEXT := MyForm.AddNewProLabel(main_lyt,'SUB_TEXT','Hello World');
    clComponent.SetupComponent(SUB_TEXT,'{"Align" : "Bottom","TextSize":14,"TextBold":"no","MarginTop":6,"MarginLeft":6}');
    testDesignerPanel.AddPanelObject(SUB_TEXT,clText1);
    
    ProImage := MyForm.AddNewProImage(main_lyt,'ProImage');
    clComponent.SetupComponent(ProImage,'{"Align" : "None","ImgUrl":" https://clomosy.com/illustration/normalman.png" rel="nofollow - https://clomosy.com/illustration/normalman.png" ,"Width":260,"Height":100, "ImgFit":"yes"}');
    testDesignerPanel.AddPanelObject(ProImage,clImage1);

 end;
 
 begin
  MyForm := TclForm.Create(Self);
  MyForm := TclForm.Create(nil);
  
  TclButton(MyForm.clFindComponent('BtnFormMenu')).Visible := False;
  TclButton(MyForm.clFindComponent('BtnGoBack')).Visible := False;
  
  MainPanelSet;
  ButtonSet;

  
  BodyLyt := MyForm.AddNewLayout(MainPnl,'BodyLyt');
  BodyLyt.Align := alMostTop;
  BodyLyt.Height := 60;
  BodyLyt.Margins.Left := 8;
  BodyLyt.Margins.Right := 8;
  BodyLyt.Margins.Top := 16;
  BodyLyt.Margins.Bottom := 16;

  SearchPanel := MyForm.AddNewProPanel(BodyLyt, 'SearchPanel');
  clComponent.SetupComponent(SearchPanel,'{"Align" : "Client",
  "Height":50,
  "BackgroundColor":"#1100ff", 
  "BorderColor":"null",
  "RoundHeight":10,
  "RoundWidth":10,
  "BorderWidth":0}');

  proSearchEdt1 := MyForm.AddNewProSearchEdit(SearchPanel,'proSearchEdt1','Search...');
  proSearchEdt1.Align := alClient;
  proSearchEdt1.Margins.Top := 6;
  proSearchEdt1.Margins.Bottom := 6;
  proSearchEdt1.Margins.Left := 6;
  proSearchEdt1.Margins.Right := 6;
   
   CreateListView;
   CreateDesignerPanel;
   CreateProductNameAndPrice;
   AddDataToListview2;
   MyForm.Run;
 end;



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