delphi4arab منتديات دلفي للعرب
اود انشآء او التعديل على ال Listbox ؟ - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15)
+--- الموضوع : اود انشآء او التعديل على ال Listbox ؟ (/showthread.php?tid=1458)

الصفحات: 1 2


اود انشآء او التعديل على ال Listbox ؟ - محمد عبد العزيز - 01-01-2010

ألق نظرة على مكون TAdvSmoothListBox
كود :
http://www.tmssoftware.com/site/advsmoothlistbox.asp



اود انشآء او التعديل على ال Listbox ؟ - AL-MOB4RM3G - 02-01-2010

إقتباس :ألق نظرة على مكون TAdvSmoothListBox

نعم بارك الله لك, الصورة التي في في البدآية كانت لذلك المكون والله المستعان, (القيت نظرة على السورس والنتيجة انني صفر في هذا المجال, لم افهم منّه الكثير) + ال items لذلك المكون ليس على شكل TStrings

مشكلتي مع ذلك المكون هو ال ScrollBar الذي يستخدما, لم يعجبني في الحقيقة كثيرا,

--

اخوآني الكرام, لأشرح لكم المهمّة بالكآمل,

اليست سيكون مثل ContactList, ويكون هناك ايضى صورة لكل Item في اليست (صورة online او offline), مثال حي, هو برنآمج السكيبي Skype , يستخم شئ اسمه TConversationListلكنه يبدوا انّه صنعه بنفسه لآنني بحثت عن هذا ولم اجده,

صورة ال Skype لمن لا يعرفه, (جوجل)
[صورة: skype1.jpg]

ال Items حبّذا لو يكونوا على هيّئة TStrings (حتى اتمكن من ارسآلهم عبر الإندي بسهولة)
يربط اليست بوكس مع مثلا مكون ImageList وكل item من ال Tstrings يمكنه اختيار احد الصور في ImageList كما هو ممكن في TAdvSmoothListBox,, وبعد ذلك يدمج هذا المكون مع الخصآئص التي وضعها الأخ هاني (الألوآن)..

القيت نطرة على مكون ال ImageListBox ولكنه لا ينفع لآنه يعتمد على ان ال Item 1 في اليست بوكس يأخذ صورة 1 في ال ImageList , وهكذا,,

خيارات العمل,
1. التعديل على مكون TAdvSmoothListBox حتى يصبح بالشكل المطلوب,
2. انشآء مكون بالخصآئص الآسمة من البدآية ان لم يكن هناك احد يعرف مكون بالخصآص المذكورة,

انا بالنسبة لي, افضل 2, لأنها تعلّمني اكثر,, اي انشآء المكون من الصفر اعتمآد على ListBox, + ان التعديل على مكون موجود ربما يحتاج الى خبرة مسبقة,

سؤآلي الآن هو اخوآني الكرام,
الخطوة الألى,
كيف ممكن اعمل حتى كل ايتيم يخأذ خصآئص مخصص له, ؟
[صورة: itemslistbox.jpg]

بارك الله لكم
والسلام عليكم


اود انشآء او التعديل على ال Listbox ؟ - AL-MOB4RM3G - 02-01-2010

السلام عليكم,
اخوآني الكرام, هذه محآولة اوليّة,,

PHP كود :
unit AListBox;

interface

uses
  SysUtils
, Classes, Controls, StdCtrls;

type
  TAListBox 
= class(TListBox)
  private
  
FItems : TCollection;
    { Private 
declarations }
  protected
    { Protected 
declarations }
  public
    { Public 
declarations }
  
published
    
{ Published declarations }
   
Property Items : TCollection Read FItems Write FItems; //
  
end;

  
TAListBoxItem = class(TCollectionItem)
  private
  
FCaption: String;  { Private declarations }
  protected
    { Protected 
declarations }
  public
    { Public 
declarations }
  
published
    
{ Published declarations }
  
Property Caption : String Read FCaption Write FCaption;
  
end;

procedure Register;

implementation

procedure Register
;
begin
  RegisterComponents
('AListBox', [TAListBox]);
end;

end. 

الآن ال Items في اليست بوكس تظهر على شكل TCollection ,, لكن لم اعرف كيف اصل ال TCollectionItem بال TCollection ؟ حتى استطيع ان اكتب لكل item كابشن خاص به,, كما في

إضآفة:
وجدت هذا المكون, شئ من هذا هو الذي ابحث عنه وأود عمله (+ خآصيّة الألوآن التي وضعها الأخ هاني) والله المستعان, هذا ديموا فقط,
رآبط, هنا,
إقتباس :http://www.sharemation.com/apkoomeh/Mypage/IListBox.zip
[صورة: IListbox.jpg]


اود انشآء او التعديل على ال Listbox ؟ - mohfa - 02-01-2010

ابداء من هنا :

كود :
unit AListBox; interface uses SysUtils, Classes, Controls, StdCtrls; type TAListBoxItem = class; //<-- here TAListBoxItems = class; // <-- here TAListBox = class(TListBox) private { Private declarations } FItems: TAListBoxItems; procedure SetItems(Items: TAListBoxItems); protected { Protected declarations } public { Public declarations } constructor Create(aOwner: TComponent); override; destructor Destroy(); override; published { Published declarations } Property Items : TAListBoxItems Read FItems Write SetItems; end; //----> added TAListBoxItem = class(TCollectionItem) private { Private declarations } FCaption: String; // from here u can add what u want ...! protected { Protected declarations } public { Public declarations } constructor Create(collection: TCollection); override; published { Published declarations } Property Caption : String Read FCaption Write FCaption; end; // ---> added TAListBoxItems = class(TCollection) private FManager: TAListBox; protected function GetOwner(): TPersistent; override; public constructor Create(manager: TAListBox); end; procedure Register; implementation procedure Register; begin RegisterComponents('Standard', [TAListBox]); end; { TAListBox } { TAListBoxItem } constructor TAListBoxItem.Create(collection: TCollection); begin inherited Create(collection); FCaption :=''; end; { TAListBoxItems } constructor TAListBoxItems.Create(manager: TAListBox); begin inherited Create(TAListBoxItem); FManager := manager; end; function TAListBoxItems.GetOwner: TPersistent; begin result := FManager; end; { TAListBox } constructor TAListBox.Create(aOwner: TComponent); begin inherited Create(aOwner); FItems := TAListBoxItems.Create(self); end; destructor TAListBox.Destroy; begin FItems.Free(); inherited Destroy(); end; procedure TAListBox.SetItems(Items: TAListBoxItems); begin FItems.Assign(Items); end; end.



اود انشآء او التعديل على ال Listbox ؟ - hanipino - 03-01-2010

محاولة صغيرة تشبه IListBox

[صورة: 988863255.png]



اود انشآء او التعديل على ال Listbox ؟ - hanipino - 03-01-2010

اضافة صغيرة

امكانية تغيير لون Border لسطر المختار .
منع مفعول الدالة DrawFocusRect ... لتحقيق دالك قمت بالتعديل على الدالة TCustomListBox.CNDrawItem الموجودة فى الوحدة StdCtrls لان هده الدالة هى التى تحتوى على الدالة DrawFocusRect .

[صورة: 546098906.png]



اود انشآء او التعديل على ال Listbox ؟ - AL-MOB4RM3G - 03-01-2010

السلام عليكم

بارك الله فيكم اخوآني الكرام على هذه المسآعدة,

مكون الأخ هاني ذكّرني بمكون ال ImageListbox Smile

لكن عندي بعض الأمور اود الإستفسار عنها,
فيما يخص هذه, TPersistent ما هو ال بيرسيستنت ؟ (موجود في كود الأخ محمد)

2. inherited ماتى تستخدم ولمآذا ؟

3. في كود الأخ محمد عند اضآفة Item جديد و كتآبة الكآبشن لا يظهر كأيتيم جديد, اعلم ان الأخ وضع كود كبدآية, لكن هل علي ان اظهر ال Text من خلال Canvas ام هناك طريقة اخرى ؟

4. الأخ هاني, هل ممكن تحديد لكل Item ًصورة بها في المكون الذي وضعته ؟
لم استطع هذا,

جزآكم الله كل خيرا وبارك الله لكم


اود انشآء او التعديل على ال Listbox ؟ - AL-MOB4RM3G - 09-01-2010

اخوآني الكرام

وجدت الحمد لله مكون شبه الذي ابحث عنه ولله الحمد,

مكون ال JvImageListBox من مكونات ال Jedi

على كل حال, بارك الله فيكم جميعا واشكر كل الإخوة على مسآعدتكم لي ,,

بارك الله لكم والسلام عليكم


اود انشآء او التعديل على ال Listbox ؟ - kachwahed - 09-01-2010

إقتباس :فيما يخص هذه, TPersistent ما هو ال بيرسيستنت ؟ (موجود في كود الأخ محمد)
مقتطف مترجم من كتاب فرنسي إلى الإنجليزية حول الفئة TPersistent
كود :
The branch TPersistent includes all VCL and CLX classes that derive from TPersistent but not TComponent. The persistence determines what is saved in a file card or a data module and which is responsible in the form or data module when it is extracted from memory. Because of their persistence, objects of that class may appear design. They may however not exist independently. Rather they implement properties for components. The properties are only loaded and saved with a sheet if they have an owner. The owner must be a component. TPersistent this method GetOwner, which allows the designer to determine the card owner Object. The classes of this class are also the first to include a section published in which the properties can be automatically loaded and saved. A method DefineProperties allows each class to indicate the how to load and save properties. Here are some other classes of TPersistent branch in the hierarchy: • Graphics such as: TBrush, and TFont tpen. • Classes such as TBitmap and Ticona, which store and display images visual and TClipboard that contains text or graphics that have been cut or copied from an application. • The lists of channels like TStringList, which represents text or lists of channels that can be used for design. • Collections and collectors' items, which are derived from or TCollection TCollectionItem. These classes manage collections of indexed items specially set belonging to a component. Examples include THeaderSections and THeaderSection or TListColumns and TListColumn.

إقتباس :2. inherited ماتى تستخدم ولمآذا ؟
تستخدم لوراثة الحدث الأصلي... راجع رد الأخ هانئ من هنا:
http://www.delphi4arab.net/forum/showthread.php?tid=2182
بالتوفيق أخي المبرمج.