دعم الاتجاه من اليسار الى اليمين
#9
السلام عليكم

تم اجراء تعديل على الوحدة السابقة فصارت كما بالشكل التالي :

كود :
unit Component1; interface uses SysUtils, Classes, Controls, forms, windows,ComCtrls,Menus; type TComponent1 = class(TComponent) procedure RigthToLeft(Value: Tform); private { private declarations } protected { Protected declarations } public { Public declarations } published { Published declarations } end; procedure Register; implementation procedure Register; begin RegisterComponents('Samples', [TComponent1]); end; Procedure SetWinControlBiDi(Control: TWinControl); var ExStyle: Longint; begin ExStyle := GetWindowLong(Control.Handle, GWL_EXSTYLE); SetWindowLong(Control.Handle, GWL_EXSTYLE, ExStyle or WS_EX_RTLREADING or WS_EX_RIGHT or WS_EX_LAYOUTRTL or WS_EX_NOINHERITLAYOUT ); Control.Invalidate; end; procedure TComponent1.RigthToLeft(Value: Tform); var myint:integer; begin SysLocale.MiddleEast := True; for myint := 0 to Value.ComponentCount - 1 do if ((Value.Components[myint] is TTreeView) or (Value.Components[myint] is TPageControl) or (Value.Components[myint] is TListView)) then begin SetWinControlBiDi(Value.Components[myint] as TWinControl); end; end; end.


حيث صار لها اجراء يمرر له بارمتر يحتوي النموذج الذي نعمل عليه وقد جربتها وهي تعمل على احسن ما يرام

حيث يتم اختبار الادوات التي لا تدعم الاتجاه من اليمين الى اليسار كما بالشكل التالي :

كود :
if ((Value.Components[myint] is TTreeView) or (Value.Components[myint] is TPageControl) or (Value.Components[myint] is TListView)) then

اذا كانت احدى الادوات التالية تم تطبيق مبداء المراءة عليها
بين الانسان والكفر ترك الصلاة فمن تركها فقد كفر .
الرد


الردود في هذا الموضوع
دعم الاتجاه من اليسار الى اليمين - بواسطة CMT-10 - 20-10-2010, 04:20 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم