Difference between revisions of "ExCtrls/ru"

From Free Pascal wiki
Jump to navigationJump to search
(Created page with "==About== ''ExCtrls'' is a collection of controls which try to overcome limitations posed by the widgetset. Moreover, some missing controls are added. ===Authors=== The packa...")
 
Line 1: Line 1:
==About==
+
{{MenuTranslate|page=ExCtrls}}
''ExCtrls'' is a collection of controls which try to overcome limitations posed by the widgetset. Moreover, some missing controls are added.
 
  
===Authors===
+
==О компоненте==
The package is written by Werner Pamler, but re-uses a lot of code of the LCL components written by the Lazarus team.
+
''ExCtrls'' представляет собой набор элементов управления, которые пытаются преодолеть ограничения, накладываемые набором виджетов. Более того, добавлены некоторые недостающие элементы управления.
  
===License===
+
===Авторство===
Modified LGPL (with linking exception, like Lazarus LCL)
+
Пакет написан Werner Pamler (Вернером Памлером), но многократно использует большой код компонентов LCL, написанных командой Lazarus.
  
===Download and Installation===
+
===Лицензия===
====Development version====
+
Модифицированная LGPL (с исключением ссылок, как Lazarus LCL)  
Use an svn client to download the current trunk version from svn://svn.code.sf.net/p/lazarus-ccr/svn/components/exctrls. Alternatively download the zipped snapshot from https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/exctrls/ and unzip it to some folder.
 
====Release version====
 
There is no release version, yet.
 
====Installation====
 
In Lazarus, go to "Package" > "Open Package File .lpk". Navigate to the folder with the ExCtrls sources, and select exctrlspkg.lkp. Click "Compile", then "Use" > "Install". This will rebuild the IDE (it may take some time). When the process is finished the IDE will restart, and you'll find the components on the palettes '''ExCtrls''' and '''LazControls'''.
 
  
== Usage ==
+
===Загрузка и установка===
===Sample code===
+
====Версия для разработчиков====
The application of each component is demonstrated by a project in the folder ''examples'' coming along with the component code.
+
Используйте клиент SVN для загрузки текущей версии транка из svn://svn.code.sf.net/p/lazarus-ccr/svn/components/exctrls. Или загрузите архив снапшота с https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/exctrls/ и распакуйте в какую-нибудь папку.
  
===TRadioButtonEx, TCheckBoxEx, TRadioGroupEx and TCheckGroupEx===
+
====Release версия====
These components re-implement the standard TRadioButton, TCheckBox, TRadioGroup and TCheckGroup, but inherit from TCustomControl and thus are not drawn by the widgetset but by the ThemeServices. As a consequence there are less widgetset related restrictions although the components look and behave like their original LCL counter-parts.
+
Пока релизных версий нет.
  
'''New features:'''
+
====Установка====
 +
В Lazarus перейдите через меню "Package"(Пакет) > "Open Package File .lpk" (Открыть файл пакета .lpk). Перейдите в папку с исходниками ExCtrls и выберите exctrlspkg.lkp. Нажмите "Compile"(Компилировать), затем "Use"(Использовать) > "Install"(Установить). Это запустит пересборку IDE (может занять некоторое время). Когда процесс будет завершен, IDE перезапустится, и вы найдете компоненты в палитрах '''ExCtrls''' и '''LazControls'''.
 +
 
 +
== Использование ==
 +
===Простой код===
 +
Применение каждого компонента демонстрируется проектом в папке ''examples'' вместе с кодом компонента.
 +
 
 +
===TRadioButtonEx, TCheckBoxEx, TRadioGroupEx и TCheckGroupEx===
 +
Эти компоненты повторно реализуют стандартные TRadioButton, TCheckBox, TRadioGroup и TCheckGroup, но наследуются от TCustomControl и, таким образом, рисуются не набором виджетов, а ThemeServices. Как следствие, существует меньше ограничений, связанных с набором виджетов, хотя компоненты выглядят и ведут себя как их исходные аналоги LCL.
 +
 
 +
'''Новые функции:'''
 
* '''Wordwrapped captions''': If the new property <tt>WordWrap</tt> is set to <tt>true</tt>, long captions are word-wrapped to fit into the width of the control. Note that when <tt>AutoSize</tt> is active before <tt>WordWrap</tt> is activated the caption is not wrapped initially and all the text is placed into a single line. Turn <tt>AutoSize</tt> off and reduce the width of the control. Once the text is wrapped <tt>AutoSize</tt> may be switche on again to adjust the height.
 
* '''Wordwrapped captions''': If the new property <tt>WordWrap</tt> is set to <tt>true</tt>, long captions are word-wrapped to fit into the width of the control. Note that when <tt>AutoSize</tt> is active before <tt>WordWrap</tt> is activated the caption is not wrapped initially and all the text is placed into a single line. Turn <tt>AutoSize</tt> off and reduce the width of the control. Once the text is wrapped <tt>AutoSize</tt> may be switche on again to adjust the height.
 
* '''Vertical layout''': <tt>ButtonLayout</tt> and <tt>TextLayout</tt> control the vertical positioning of checkbox/radiobutton and caption, respectively. Default is <tt>tlCenter</tt>, i.e. the corresponding element is centered vertically within the bounds of the control; other values are <tt>tlTop</tt> and <tt>tlBottom</tt>. Normally <tt>ButtonLayout</tt> and <tt>TextLayout</tt> are changed in pairs.
 
* '''Vertical layout''': <tt>ButtonLayout</tt> and <tt>TextLayout</tt> control the vertical positioning of checkbox/radiobutton and caption, respectively. Default is <tt>tlCenter</tt>, i.e. the corresponding element is centered vertically within the bounds of the control; other values are <tt>tlTop</tt> and <tt>tlBottom</tt>. Normally <tt>ButtonLayout</tt> and <tt>TextLayout</tt> are changed in pairs.

Revision as of 00:49, 23 May 2020

Template:MenuTranslate

О компоненте

ExCtrls представляет собой набор элементов управления, которые пытаются преодолеть ограничения, накладываемые набором виджетов. Более того, добавлены некоторые недостающие элементы управления.

Авторство

Пакет написан Werner Pamler (Вернером Памлером), но многократно использует большой код компонентов LCL, написанных командой Lazarus.

Лицензия

Модифицированная LGPL (с исключением ссылок, как Lazarus LCL)

Загрузка и установка

Версия для разработчиков

Используйте клиент SVN для загрузки текущей версии транка из svn://svn.code.sf.net/p/lazarus-ccr/svn/components/exctrls. Или загрузите архив снапшота с https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/exctrls/ и распакуйте в какую-нибудь папку.

Release версия

Пока релизных версий нет.

Установка

В Lazarus перейдите через меню "Package"(Пакет) > "Open Package File .lpk" (Открыть файл пакета .lpk). Перейдите в папку с исходниками ExCtrls и выберите exctrlspkg.lkp. Нажмите "Compile"(Компилировать), затем "Use"(Использовать) > "Install"(Установить). Это запустит пересборку IDE (может занять некоторое время). Когда процесс будет завершен, IDE перезапустится, и вы найдете компоненты в палитрах ExCtrls и LazControls.

Использование

Простой код

Применение каждого компонента демонстрируется проектом в папке examples вместе с кодом компонента.

TRadioButtonEx, TCheckBoxEx, TRadioGroupEx и TCheckGroupEx

Эти компоненты повторно реализуют стандартные TRadioButton, TCheckBox, TRadioGroup и TCheckGroup, но наследуются от TCustomControl и, таким образом, рисуются не набором виджетов, а ThemeServices. Как следствие, существует меньше ограничений, связанных с набором виджетов, хотя компоненты выглядят и ведут себя как их исходные аналоги LCL.

Новые функции:

  • Wordwrapped captions: If the new property WordWrap is set to true, long captions are word-wrapped to fit into the width of the control. Note that when AutoSize is active before WordWrap is activated the caption is not wrapped initially and all the text is placed into a single line. Turn AutoSize off and reduce the width of the control. Once the text is wrapped AutoSize may be switche on again to adjust the height.
  • Vertical layout: ButtonLayout and TextLayout control the vertical positioning of checkbox/radiobutton and caption, respectively. Default is tlCenter, i.e. the corresponding element is centered vertically within the bounds of the control; other values are tlTop and tlBottom. Normally ButtonLayout and TextLayout are changed in pairs.
  • User provided check images: The checkboxes and radiobuttons are normally drawn by the ThemeServices, but it is possible to provide dedicated bitmaps which can be used instead. The bitmaps must be stored in a TImageList attached to property Images. The corresponding image index must be assigned in a handler of the event OnGetImageIndex which has appropriate parameters to distinguishe between mouse-over, pressed, enabled/disabled and checked/unchecked states.
  • Custom caption colors and font settings: The font of the caption can be changed when the property ThemedCaption is switched to false. In case of TRadioGroupEx the font of individual items can only be changed at runtime by accessing the RadioGroup1.Buttons[Andex] property pointing to the TRadioButtonEx at the given index in the groupbox. The same is possible also with the TCheckGroupEx.

checkcontrolsEx.png

TCurrSpinEditEx

The default LazControls palette contains already extended spin edit controls for integers and floating point numbers (TSpinEditEx and TFloatSpinEditEx, respectively). The missing edit for currency values is implemented in package ExCtrls. Component registration put the TCurrSpinEditEx on the palette LazControls.

New and modified properties

  • Value: The data type of the control is currency.
  • CurrencyString: The currency name, for example '$' or '€', is added to the numeric value in the edit box. The default value is taken from the DefaultFormatSettings provided by the SysUtils unit.
  • CurrencyFormat: Defines the order of (positive) numeric value and currency name in the edit field:
    • secfCurrVal: currency string first, no space (e.g. '$1')
    • secfValCurr: value first, no space (e.g. '1$')
    • secfCurrSpaceVal: currency string first, space to value (e.g. '$ 1');
    • secfValSpaceCurr: value first, space to currency string (e.g. '1 $');
  • NegCurrencyFormat: Like CurrencyFormat, but now for negative values:
    • sencfParCurrValPar: currency string first, no space, the entire string is put in parenthesis (e.g. '($1)')
    • sencfMinusCurrVal: currency string first with leading '-' character, no space (e.g. '-1$')
    • sencfCurrMinusVal: currency string first, no space, '-' at value (e.g. '$-1')
    • sencfCurrValMinus: currency string first, value with appended '-' (eg. '$1-')
    • etc... Other allowed values are sencfParValCurrPar ('1$'), sencfMinusValCurr ('-1$'), sencfValMinusCurr ('1-$'), sencfValCurrMinus ('1$-'), sencfMinusValSpaceCurr ('-1 $'), sencfMinusCurrSpaceVal ('-$ 1'), sencfValSpaceCurrMinus ('1 $-'), sencfCurrSpaceValMinus ('$ 1-'), sencfCurrSpaceMinusVal ('$ -1'), sencfValMinusSpaceCurr ('1- $'), sencfParCurrSpaceValPar ('($ 1)'), sencfParValSpaceCurrPar ('(1 $)')
  • DecimalSeparator: Character used to separate decimals from the integer part. Defaults to the value defined by the DefaultFormatSettings.
  • ThousandSeparator:If not empty (i.e. not #0) the integer part of the Value is formatted with a thousand separator for better readability. Note that the control does not allow DecimalSeparator and ThousandSeparator to be equal.

savingscalculator.png