TScrollBar/fr: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | Un **TScrollBar** [](</File:tscrollbar.png>) est un contrôle qui permet à l'utilisateur de défiler le contenu d'un contrôle associé en déplaçant un curseur (_slider_). | |
| 2 | 2 | ||
| 3 | 3 | # Usage | |
| 4 | 4 | ||
| 5 | - | ||
| 5 | + | Pour utiliser un TScrollBar sur une [[TForm/fr|fiche]], vous pouvez simplement le sélectionner sur l'[[Standard tab/fr|onglet Standard]] de la [[Component Palette/fr|palette de composants]] et le placer en cliquant sur la fiche. | |
| 6 | 6 | ||
| 7 | 7 | # Petit exemple | |
| 8 | 8 | ||
| 9 | - | ||
| 9 | + | Déplacez sur image sur votre fiche selon les positions du ScrollBar. | |
| 10 | 10 | ||
| 11 | - | ||
| 12 | - | ||
| 13 | - | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 11 | + | * Placez deux ScrollBars sur votre fiche. | |
| 12 | + | * Dans l'inspecteur d'objet, modifiez les propriétés du premier ScrollBar "Name" en "sbVert", "Kind" en "sbVertical" et "Align" en "alRight" | |
| 13 | + | * Dans l'inspecteur d'objet, modifiez les propriétés du second ScrollBar "Name" en "sbHori" et "Align" en "alBottom". | |
| 14 | + | * Ajoutez un [[TPaintBox/fr|TPaintBox]] (onglet Additional de la palette de composants) à la fiche et définissez sa propriété "align" en "alClient". | |
| 15 | + | * Ajoutez un [[TImageList/fr|TImageList]] (onglet Coommion controls de la palette de composants) sur la fiche. | |
| 16 | + | * Chargez une image dans l'ImageList: | |
| 17 | + | * Cliquez droit sur ImageList1 et sélectionner _l'éditeur de liste d'image..._ depuis le menu pop-up. | |
| 18 | + | * Cliquez sur _Ajouter_ et sélectionner une image (de préférence une petite icône de 16x16 par exemple, dans le répertoire Lazarus/images/icons/lazarus16x16) | |
| 19 | + | * Terminez votre sélection avec _OK_. | |
| 20 | + | * Choisissez votre PaintBox, dans l'inspecteur d'objet, dans l'onglet Evénements, créez le gestionnaire d'événément pour _OnPaint_ et écrivez le code suivant : | |
| 21 | 21 | ||
| 22 | - | ||
| 22 | + | ``` | |
| 23 | 23 | procedure TForm1.PaintBox1Paint(Sender: TObject); | |
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 27 | - | ||
| 28 | - | ||
| 29 | - | ||
| 30 | - | ||
| 24 | + | begin | |
| 25 | + | ImageList1.Draw( | |
| 26 | + | Paintbox1.Canvas, | |
| 27 | + | sbHori.Position * (PaintBox1.ClientWidth - ImageList1.Width) div sbHori.Max, | |
| 28 | + | sbVert.Position * (Paintbox1.ClientHeight - ImageList1.Height) div sbVert.Max, | |
| 29 | + | 0); | |
| 30 | + | end; | |
| 31 | 31 | ``` | |
| 32 | 32 | ||
| 33 | - | ||
| 33 | + | * Maintenant faites que tout changement des positions des Scrollbar repeignent la fiche : créez le gestionnaire d'événement _OnChange_ pour un ScrollBar et appelez-le aussi pour l'autre Scrollbar. | |
| 34 | 34 | ||
| 35 | - | ||
| 35 | + | ``` | |
| 36 | 36 | procedure TForm1.sbVertChange(Sender: TObject); | |
| 37 | - | ||
| 38 | - | ||
| 39 | - | ||
| 37 | + | begin | |
| 38 | + | RePaint; | |
| 39 | + | end; | |
| 40 | 40 | ``` | |
| 41 | 41 | ||
| 42 | - | ||
| 42 | + | Votre petit programme pourrait ressembler à ceci : | |
| 43 | 43 | ||
| 44 | - | ||
| 44 | + | [](</File:ScrollBarExample.png>) | |
| 45 | 45 | ||
| 46 | 46 | # Voir aussi | |
| 47 | 47 | ||
| 48 | - | ||
| 49 | - | ||
| 50 | - | ||
| 48 | + | * [Doc. TScrollBar](<http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tscrollbar.html> "doc:lcl/stdctrls/tscrollbar.html") | |
| 49 | + | * [[TTrackBar/fr|TTrackBar]] | |
| 50 | + | * [[TScrollBox/fr|TScrollBox]] | |
| 51 | 51 | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + | [[LCL Components/fr|Composant LCL]] Onglet de palette | Composants | |
| 55 | + | ---|--- | |
| 56 | + | [[Standard tab/fr|Standard]] | [[TMainMenu/fr|TMainMenu]] • [[TPopupMenu/fr|TPopupMenu]] • [[TButton/fr|TButton]] • [[TLabel/fr|TLabel]] • [[TEdit/fr|TEdit]] • [[TMemo/fr|TMemo]] • [[TToggleBox/fr|TToggleBox]] • [[TCheckBox/fr|TCheckBox]] • [[TRadioButton/fr|TRadioButton]] • [[TListBox/fr|TListBox]] • [[TComboBox/fr|TComboBox]] • TScrollBar • [[TGroupBox/fr|TGroupBox]] • [[TRadioGroup/fr|TRadioGroup]] • [[TCheckGroup/fr|TCheckGroup]] • [[TPanel/fr|TPanel]] • [[TFrame/fr|TFrame]] • [[TActionList/fr|TActionList]] | |
| 57 | + | [[Additional tab/fr|Additional]] | [[TBitBtn/fr|TBitBtn]] • [[TSpeedButton/fr|TSpeedButton]] • [[TStaticText/fr|TStaticText]] • [[TImage/fr|TImage]] • [[TShape/fr|TShape]] • [[TBevel/fr|TBevel]] • [[TPaintBox/fr|TPaintBox]] • [[TNotebook/fr|TNotebook]] • [[TLabeledEdit/fr|TLabeledEdit]] • [[TSplitter/fr|TSplitter]] • [[TTrayIcon/fr|TTrayIcon]] • [[TControlBar/fr|TControlBar]] • [[TFlowPanel/fr|TFlowPanel]] • [[TMaskEdit/fr|TMaskEdit]] • [[TCheckListBox/fr|TCheckListBox]] • [[TScrollBox/fr|TScrollBox]] • [[TApplicationProperties/fr|TApplicationProperties]] • [[TStringGrid/fr|TStringGrid]] • [[TDrawGrid/fr|TDrawGrid]] • [[TPairSplitter/fr|TPairSplitter]] • [[TColorBox/fr|TColorBox]] • [[TColorListBox/fr|TColorListBox]] • [[TValueListEditor/fr|TValueListEditor]] | |
| 58 | + | [[Common Controls tab/fr|Common Controls]] | [[TTrackBar/fr|TTrackBar]] • [[TProgressBar/fr|TProgressBar]] • [[TTreeView/fr|TTreeView]] • [[TListView/fr|TListView]] • [[TStatusBar/fr|TStatusBar]] • [[TToolBar/fr|TToolBar]] • [[TCoolBar/fr|TCoolBar]] • [[TUpDown/fr|TUpDown]] • [[TPageControl/fr|TPageControl]] • [[TTabControl/fr|TTabControl]] • [[THeaderControl/fr|THeaderControl]] • [[TImageList/fr|TImageList]] • [[TPopupNotifier/fr|TPopupNotifier]] • [[TDateTimePicker/fr|TDateTimePicker]] | |
| 59 | + | [[Dialogs tab/fr|Dialogs]] | [[TOpenDialog/fr|TOpenDialog]] • [[TSaveDialog/fr|TSaveDialog]] • [[TSelectDirectoryDialog/fr|TSelectDirectoryDialog]] • [[TColorDialog/fr|TColorDialog]] • [[TFontDialog/fr|TFontDialog]] • [[TFindDialog/fr|TFindDialog]] • [[TReplaceDialog/fr|TReplaceDialog]] • [[TOpenPictureDialog/fr|TOpenPictureDialog]] • [[TSavePictureDialog/fr|TSavePictureDialog]] • [[TCalendarDialog/fr|TCalendarDialog]] • [[TCalculatorDialog/fr|TCalculatorDialog]] • [[TPrinterSetupDialog/fr|TPrinterSetupDialog]] • [[TPrintDialog/fr|TPrintDialog]] • [[TPageSetupDialog/fr|TPageSetupDialog]] • [[TTaskDialog/fr|TTaskDialog]] | |
| 60 | + | [[Data Controls tab/fr|Data Controls]] | [[TDBNavigator/fr|TDBNavigator]] • [[TDBText/fr|TDBText]] • [[TDBEdit/fr|TDBEdit]] • [[TDBMemo/fr|TDBMemo]] • [[TDBImage/fr|TDBImage]] • [[TDBListBox/fr|TDBListBox]] • [[TDBLookupListBox/fr|TDBLookupListBox]] • [[TDBComboBox/fr|TDBComboBox]] • [[TDBLookupComboBox/fr|TDBLookupComboBox]] • [[TDBCheckBox/fr|TDBCheckBox]] • [[TDBRadioGroup/fr|TDBRadioGroup]] • [[TDBCalendar/fr|TDBCalendar]] • [[TDBGroupBox/fr|TDBGroupBox]] • [[TDBGrid/fr|TDBGrid]] • [[TDBDateTimePicker/fr|TDBDateTimePicker]] | |
| 61 | + | [[Data Access tab/fr|Data Access]] | [[TDataSource/fr|TDataSource]] • [[TBufDataset/fr|TBufDataset]] • [[TMemDataset/fr|TMemDataset]] • [[TSdfDataSet/fr|TSdfDataSet]] • [[TFixedFormatDataSet/fr|TFixedFormatDataSet]] • [[TDbf/fr|TDbf]] | |
| 62 | + | [[System tab/fr|System]] | [[TTimer/fr|TTimer]] • [[TIdleTimer/fr|TIdleTimer]] • [[TLazComponentQueue/fr|TLazComponentQueue]] • [[THTMLHelpDatabase/fr|THTMLHelpDatabase]] • [[THTMLBrowserHelpViewer/fr|THTMLBrowserHelpViewer]] • [[TAsyncProcess/fr|TAsyncProcess]] • [[TProcessUTF8/fr|TProcessUTF8]] • [[TProcess/fr|TProcess]] • [[TSimpleIPCClient/fr|TSimpleIPCClient]] • [[TSimpleIPCServer/fr|TSimpleIPCServer]] • [[TXMLConfig/fr|TXMLConfig]] • [[TEventLog/fr|TEventLog]] • [[TServiceManager/fr|TServiceManager]] • [[TCHMHelpDatabase/fr|TCHMHelpDatabase]] • [[TLHelpConnector/fr|TLHelpConnector]] | |
| 63 | + | [[Misc tab/fr|Misc]] | [[TColorButton/fr|TColorButton]] • [[TSpinEdit/fr|TSpinEdit]] • [[TFloatSpinEdit/fr|TFloatSpinEdit]] • [[TArrow/fr|TArrow]] • [[TCalendar/fr|TCalendar]] • [[TEditButton/fr|TEditButton]] • [[TFileNameEdit/fr|TFileNameEdit]] • [[TDirectoryEdit/fr|TDirectoryEdit]] • [[TDateEdit/fr|TDateEdit]] • [[TTimeEdit/fr|TTimeEdit]] • [[TCalcEdit/fr|TCalcEdit]] • [[TFileListBox/fr|TFileListBox]] • [[TFilterComboBox/fr|TFilterComboBox]] • [[TComboBoxEx/fr|TComboBoxEx]] • [[TCheckComboBox/fr|TCheckComboBox]] • [[TButtonPanel/fr|TButtonPanel]] • [[TShellTreeView/fr|TShellTreeView]] • [[TShellListView/fr|TShellListView]] • [[TXMLPropStorage/fr|TXMLPropStorage]] • [[TINIPropStorage/fr|TINIPropStorage]] • [[TIDEDialogLayoutStorage/fr|TIDEDialogLayoutStorage]] • [[TMRUManager/fr|TMRUManager]] • [[TStrHolder/fr|TStrHolder]] | |
| 64 | + | [[LazControls tab/fr|LazControls]] | [[TCheckBoxThemed/fr|TCheckBoxThemed]] • [[TDividerBevel/fr|TDividerBevel]] • [[TExtendedNotebook/fr|TExtendedNotebook]] • [[TListFilterEdit/fr|TListFilterEdit]] • [[TListViewFilterEdit/fr|TListViewFilterEdit]] • [[TTreeFilterEdit/fr|TTreeFilterEdit]] • [[TShortPathEdit/fr|TShortPathEdit]] • [[TLvlGraphControl/fr|TLvlGraphControl]] | |
| 65 | + | [[RTTI tab/fr|RTTI]] | [[TTIEdit/fr|TTIEdit]] • [[TTIComboBox/fr|TTIComboBox]] • [[TTIButton/fr|TTIButton]] • [[TTICheckBox/fr|TTICheckBox]] • [[TTILabel/fr|TTILabel]] • [[TTIGroupBox/fr|TTIGroupBox]] • [[TTIRadioGroup/fr|TTIRadioGroup]] • [[TTICheckGroup/fr|TTICheckGroup]] • [[TTICheckListBox/fr|TTICheckListBox]] • [[TTIListBox/fr|TTIListBox]] • [[TTIMemo/fr|TTIMemo]] • [[TTICalendar/fr|TTICalendar]] • [[TTIImage/fr|TTIImage]] • [[TTIFloatSpinEdit/fr|TTIFloatSpinEdit]] • [[TTISpinEdit/fr|TTISpinEdit]] • [[TTITrackBar/fr|TTITrackBar]] • [[TTIProgressBar/fr|TTIProgressBar]] • [[TTIMaskEdit/fr|TTIMaskEdit]] • [[TTIColorButton/fr|TTIColorButton]] • [[TMultiPropertyLink/fr|TMultiPropertyLink]] • [[TTIPropertyGrid/fr|TTIPropertyGrid]] • [[TTIGrid/fr|TTIGrid]] | |
| 66 | + | [[SQLdb tab/fr|SQLdb]] | [[TSQLQuery/fr|TSQLQuery]] • [[TSQLTransaction/fr|TSQLTransaction]] • [[TSQLScript/fr|TSQLScript]] • [[TSQLConnector/fr|TSQLConnector]] • [[TMSSQLConnection/fr|TMSSQLConnection]] • [[TSybaseConnection/fr|TSybaseConnection]] • [[TPQConnection/fr|TPQConnection]] • [[TPQTEventMonitor/fr|TPQTEventMonitor]] • [[TOracleConnection/fr|TOracleConnection]] • [[TODBCConnection/fr|TODBCConnection]] • [[TMySQL40Connection/fr|TMySQL40Connection]] • [[TMySQL41Connection/fr|TMySQL41Connection]] • [[TMySQL50Connection/fr|TMySQL50Connection]] • [[TMySQL51Connection/fr|TMySQL51Connection]] • [[TMySQL55Connection/fr|TMySQL55Connection]] • [[TMySQL56Connection/fr|TMySQL56Connection]] • [[TSQLite3Connection/fr|TSQLite3Connection]] • [[TIBConnection/fr|TIBConnection]] • [[TFBAdmin/fr|TFBAdmin]] • [[TFBEventMonitor/fr|TFBEventMonitor]] • [[TSQLDBLibraryLoader/fr|TSQLDBLibraryLoader]] | |
| 67 | + | [[Pascal Script tab/fr|Pascal Script]] | [[TPSScript/fr|TPSScript]] • [[TPSScriptDebugger/fr|TPSScriptDebugger]] • [[TPSDllPlugin/fr|TPSDllPlugin]] • [[TPSImport Classes/fr|TPSImport_Classes]] • [[TPSImport DateUtils/fr|TPSImport_DateUtils]] • [[TPSImport ComObj/fr|TPSImport_ComObj]] • [[TPSImport DB/fr|TPSImport_DB]] • [[TPSImport Forms/fr|TPSImport_Forms]] • [[TPSImport Controls/fr|TPSImport_Controls]] • [[TPSImport StdCtrls/fr|TPSImport_StdCtrls]] • [[TPSCustomPlugin/fr|TPSCustomPlugin]] | |
| 68 | + | [[SynEdit tab/fr|SynEdit]] | [[TSynEdit/fr|TSynEdit]] • [[TSynCompletion/fr|TSynCompletion]] • [[TSynAutoComplete/fr|TSynAutoComplete]] • [[TSynMacroRecorder/fr|TSynMacroRecorder]] • [[TSynExporterHTML/fr|TSynExporterHTML]] • [[TSynPluginSyncroEdit/fr|TSynPluginSyncroEdit]] • [[TSynPasSyn/fr|TSynPasSyn]] • [[TSynFreePascalSyn/fr|TSynFreePascalSyn]] • [[TSynCppSyn/fr|TSynCppSyn]] • [[TSynJavaSyn/fr|TSynJavaSyn]] • [[TSynPerlSyn/fr|TSynPerlSyn]] • [[TSynHTMLSyn/fr|TSynHTMLSyn]] • [[TSynXMLSyn/fr|TSynXMLSyn]] • [[TSynLFMSyn/fr|TSynLFMSyn]] • [[TSynDiffSyn/fr|TSynDiffSyn]] • [[TSynUNIXShellScriptSyn/fr|TSynUNIXShellScriptSyn]] • [[TSynCssSyn/fr|TSynCssSyn]] • [[TSynPHPSyn/fr|TSynPHPSyn]] • [[TSynTeXSyn/fr|TSynTeXSyn]] • [[TSynSQLSyn/fr|TSynSQLSyn]] • [[TSynPythonSyn/fr|TSynPythonSyn]] • [[TSynVBSyn/fr|TSynVBSyn]] • [[TSynAnySyn/fr|TSynAnySyn]] • [[TSynMultiSyn/fr|TSynMultiSyn]] • [[TSynBatSyn/fr|TSynBatSyn]] • [[TSynIniSyn/fr|TSynIniSyn]] • [[TSynPoSyn/fr|TSynPoSyn]] | |
| 69 | + | [[Chart tab/fr|Chart]] | [[TChart/fr|TChart]] • [[TListChartSource/fr|TListChartSource]] • [[TRandomChartSource/fr|TRandomChartSource]] • [[TUserDefinedChartSource/fr|TUserDefinedChartSource]] • [[TCalculatedChartSource/fr|TCalculatedChartSource]] • [[TDbChartSource/fr|TDbChartSource]] • [[TChartToolset/fr|TChartToolset]] • [[TChartAxisTransformations/fr|TChartAxisTransformations]] • [[TChartStyles/fr|TChartStyles]] • [[TChartLegendPanel/fr|TChartLegendPanel]] • [[TChartNavScrollBar/fr|TChartNavScrollBar]] • [[TChartNavPanel/fr|TChartNavPanel]] • [[TIntervalChartSource/fr|TIntervalChartSource]] • [[TDateTimeIntervalChartSource/fr|TDateTimeIntervalChartSource]] • [[TChartListBox/fr|TChartListBox]] • [[TChartExtentLink/fr|TChartExtentLink]] • [[TChartImageList/fr|TChartImageList]] | |
| 70 | + | [[IPro tab/fr|IPro]] | [[TIpFileDataProvider/fr|TIpFileDataProvider]] • [[TIpHttpDataProvider/fr|TIpHttpDataProvider]] • [[TIpHtmlPanel/fr|TIpHtmlPanel]] | |
| 71 | + | ||
| 52 | 72 | --- | |
| 53 | - | ||
| 73 | + | *From the Free Pascal wiki, page "TScrollBar/fr", as the Internet Archive kept it on 2025-02-17, last changed on 2020-03-02. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
