TScrollBar/de: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 1 | + | Diese Seite erklärt, wie man die [TScrollBar](<http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tscrollbar.html> "doc:lcl/stdctrls/tscrollbar.html") Komponente verwendet. Auf etwas klicken bedeutet immer ein Linksklick, ein Rechtsklick wird explizit erwähnt. | |
| 2 | 2 | ||
| 3 | 3 | ## Beschreibung | |
| 4 | 4 | ||
| 5 | - | ||
| 5 | + | Ein Steuerelement, welches dem Benutzer erlaubt, den Inhalt eines zugeordneten Steuerelements zu blättern, indem dieser einen Schieberegler verschiebt. | |
| 6 | 6 | ||
| 7 | - | ||
| 7 | + | [](</File:Comp_Standard_TScrollBar.png>) | |
| 8 | 8 | ||
| 9 | 9 | ## Verwendung | |
| 10 | 10 | ||
| 11 | - | ||
| 11 | + | Um eine Komponente [TScrollBar](<http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tscrollbar.html> "doc:lcl/stdctrls/tscrollbar.html") auf einem [[TForm/de|Formular]] zu nutzen, können sie diese einfach auf der Komponentenpalette _Standard_ auswählen und, mit einem Klick auf das Formular, platzieren. | |
| 12 | 12 | ||
| 13 | 13 | #### Kleines Beispiel | |
| 14 | 14 | ||
| 15 | - | ||
| 15 | + | Verschieben Sie ein Image auf Ihrem Formular in Abhängigkeit der Scrollbarpositionen | |
| 16 | 16 | ||
| 17 | - | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - | ||
| 22 | - | ||
| 23 | - | ||
| 24 | - | ||
| 25 | - | ||
| 26 | - | ||
| 17 | + | * platzieren Sie zwei TScrollBars auf Ihrem Formular | |
| 18 | + | * ändern Sie im Objektinspektor die Eigenschaften der ersten Scrollbar _Name_ in _sbVert_ , _Kind_ in _sbVertical_ und _Align_ in _alRight_ | |
| 19 | + | * ändern Sie im Objektinspektor die Eigenschaften der zweiten Scrollbar _Name_ in _sbHori_ und _Align_ in _alBottom_ | |
| 20 | + | * fügen Sie eine [[TPaintBox/de|TPaintBox]] (Komponentenpalette Additional) dem Formular hinzu und stellen Sie dessen _Align_ auf _alClient_ | |
| 21 | + | * fügen Sie noch eine [[TImageList/de|TImageList]] (Komponentenpalette Common Controls) dem Formular hinzu | |
| 22 | + | * laden Sie ein Image in die ImageList: | |
| 23 | + | * rechtsklicken Sie die ImageList1 und wählen Sie den _ImageList-Editor..._ im Popupmenü aus | |
| 24 | + | * klicken Sie auf _Hinzufügen_ und wählen ein Image (möglichst ein kleines Icon 16x16 z.B. unter Lazarus/Images/icons/lazarus16x16) | |
| 25 | + | * beenden Sie Ihre Wahl mit _OK_ | |
| 26 | + | * wählen Sie Ihre PaintBox an und erstellen Sie im Objektinspektor unter Ereignisse den Eventhandler für das Ereignis _OnPaint_ und schreiben Sie folgenden Quelltext hinein: | |
| 27 | 27 | ||
| 28 | - | ||
| 28 | + | ``` | |
| 29 | 29 | procedure TForm1.PaintBox1Paint(Sender: TObject); | |
| 30 | - | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - | ||
| 36 | - | ||
| 30 | + | begin | |
| 31 | + | ImageList1.Draw( | |
| 32 | + | Paintbox1.Canvas, | |
| 33 | + | sbHori.Position * (PaintBox1.ClientWidth - ImageList1.Width) div sbHori.Max, | |
| 34 | + | sbVert.Position * (Paintbox1.ClientHeight - ImageList1.Height) div sbVert.Max, | |
| 35 | + | 0); | |
| 36 | + | end; | |
| 37 | 37 | ``` | |
| 38 | 38 | ||
| 39 | - | ||
| 39 | + | * nun lassen Sie bei jeder Änderung der Scrollbarpositionen das Formular neu zeichnen, indem Sie den Eventhandler _OnChange_ für eine ScrollBar erstellen und diesen für die andere Scrollbar ebenfalls aufrufen: | |
| 40 | 40 | ||
| 41 | - | ||
| 41 | + | ``` | |
| 42 | 42 | procedure TForm1.sbVertChange(Sender: TObject); | |
| 43 | - | ||
| 44 | - | ||
| 45 | - | ||
| 43 | + | begin | |
| 44 | + | RePaint; | |
| 45 | + | end; | |
| 46 | 46 | ``` | |
| 47 | 47 | ||
| 48 | - | ||
| 48 | + | So könnte Ihr kleines Programm aussehen: | |
| 49 | 49 | ||
| 50 | - | ||
| 50 | + | [](</File:ScrollBarExample.png>) | |
| 51 | 51 | ||
| 52 | 52 | ## Siehe auch | |
| 53 | 53 | ||
| 54 | - | ||
| 54 | + | [[TTrackBar/de|TTrackBar]] | |
| 55 | 55 | [[TScrollBox/de|TScrollBox]] | |
| 56 | 56 | ||
| 57 | + | * * * | |
| 58 | + | ||
| 59 | + | Gehe zurück zu: [[LCL Components/de|LCL Components]] | — Komponente zuvor: [[TComboBox/de]] | Nächste Komponente: [[TGroupBox/de]] | |
| 60 | + | ---|---|--- | |
| 61 | + | [[LCL Components/de|LCL Komponenten]] Komponenten Tab | Komponenten | |
| 62 | + | ---|--- | |
| 63 | + | Standard | [[TMainMenu/de|TMainMenu]] • [[TPopupMenu/de|TPopupMenu]] • [[TButton/de|TButton]] • [[TLabel/de|TLabel]] • [[TEdit/de|TEdit]] • [[TMemo/de|TMemo]] • [[TToggleBox/de|TToggleBox]] • [[TCheckBox/de|TCheckBox]] • [[TRadioButton/de|TRadioButton]] • [[TListBox/de|TListBox]] • [[TComboBox/de|TComboBox]] • TScrollBar • [[TGroupBox/de|TGroupBox]] • [[TRadioGroup/de|TRadioGroup]] • [[TCheckGroup/de|TCheckGroup]] • [[TPanel]] • [[Frames|TFrame]] • [[TActionList]] | |
| 64 | + | Additional | [[TBitBtn]] • [[TSpeedBtn]] • [[TStaticText]] • [[TImage]] • [[TShape]] • [[TBevel]] • [[TPaintBox]] • [[TNotebook]] • [[TLabeledEdit]] • [[TSplitter/de|TSplitter]] • [[TTrayIcon]] • [[TMaskEdit]] • [[TCheckListBox]] • [[TScrollBox]] • [[TApplicationProperties]] • [[TStringGrid]] • [[TDrawGrid]] • [[TPairSplitter]] • [[TColorBox]] • [[TColorListBox]] • [[TValueListEditor]] | |
| 65 | + | Common Controls | [[TTrackBar]] • [[TProgressBar]] • [[TTreeView]] • [[TListView]] • [[TStatusBar]] • [[TToolBar]] • [[TUpDown]] • [[TPageControl]] • [[TTabControl]] • [[THeaderControl]] • [[TImageList]] • [[TPopupNotifier]] | |
| 66 | + | Dialogs | [[TOpenDialog]] • [[TSaveDialog]] • [[TSelectDirectoryDialog]] • [[TColorDialog]] • [[TFontDialog]] • [[TFindDialog]] • [[TReplaceDialog]] • [[TOpenPictureDialog]] • [[TSavePictureDialog]] • [[TCalendarDialog]] • [[TCalculatorDialog]] • [[TPrinterSetupDialog]] • [[TPrintDialog]] • [[TPageSetupDialog]] | |
| 67 | + | Data Controls | [[TDBNavigator]] • [[TDBText]] • [[TDBEdit]] • [[TDBMemo]] • [[TDBImage]] • [[TDBListBox]] • [[TDBLookupListBox]] • [[TDBComboBox]] • [[TDBLookupComboBox]] • [[TDBCheckBox]] • [[TDBRadioGroup]] • [[TDBCalendar]] • [[TDBGroupBox]] • [[TDBGrid]] | |
| 68 | + | System | [[TTimer]] • [[TIdleTimer]] • [[TLazComponentQueue]] • [[THTMLHelpDatabase]] • [[THTMLBrowserHelpViewer]] • [[TAsyncProcess]] • [[TProcessUTF8]] • [[TProcess]] • [[TSimpleIPCClient]] • [[TXMLConfig]] • [[TEventLog]] • [[TServiceManager]] | |
| 69 | + | Misc | [[TColorButton]] • [[TSpinEdit]] • [[TFloatSpinEdit]] • [[TArrow]] • [[TCalendar]] • [[TEditButton]] • [[TFileNameEdit]] • [[TDirectoryEdit]] • [[TDateEdit]] • [[TCalcEdit]] • [[TFileListBox]] • [[TFilterComboBox]] • [[TXMLPropStorage/de|TXMLPropStorage]] • [[TINIPropStorage/de|TINIPropStorage]] • [[TBarChart]] • [[TButtonPanel]] • [[TShellTreeView]] • [[TShellListView]] • [[TIDEDialogLayoutStorage]] | |
| 70 | + | Data Access | [[TDatasource]] • [[TBufDataset]] • [[TMemDataset]] • [[TSdfDataset]] • [[TFixedFormatDataSet]] • [[TDbf]] | |
| 71 | + | SynEdit | [[TSynEdit]] • [[TSynMemo]] • [[TSynCompletion]] • [[TSynAutoComplete]] • [[TSynMacroRecorder]] • [[TSynExporterHTML]] • [[TsynPluginSyncroEdit]] • [[TSynPasSyn]] • [[TSynFreePascalSyn]] • [[TSynCppSyn]] • [[TSynJavaSyn]] • [[TSynPerlSyn]] • [[TSynHTMLSyn]] • [[TSynXMLSyn]] • [[TSynLFMSyn]] • [[TSynDiffSyn]] • [[TSynUNIXShellScriptSyn]] • [[TSynCssSyn]] • [[TSynPHPSyn]] • [[TSynTeXSyn]] • [[TSynSQLSyn]] • [[TSynPythonSyn]] • [[TSynVBSyn]] • [[TSynAnySyn]] • [[TSynMultiSyn]] • [[TSynBatSyn]] • [[TSynIniSyn]] • [[TSynPoSyn]] | |
| 72 | + | LazControls | [[TDividerBevel]] • [[TExtendedNotebook]] • [[TListFilterEdit]] • [[TTreeFilterEdit]] | |
| 73 | + | RTTI | [[TTIEdit]] • [[TTIComboBox]] • [[TTIButton]] • [[TTICheckBox]] • [[TTILabel]] • [[TTIGroupBox]] • [[TTIRadioGroup]] • [[TTICheckGroup]] • [[TTICheckListBox]] • [[TTIListBox]] • [[TTIMemo]] • [[TTICalendar]] • [[TTIImage]] • [[TTIFloatSpinEdit]] • [[TTISpinEdit]] • [[TTITrackBar]] • [[TTIProgressBar]] • [[TTIMaskEdit]] • [[TTIColorButton]] • [[TMultiPropertyLink]] • [[TTIPropertyGrid]] • [[TTIGrid]] | |
| 74 | + | IPro | [[TIpFileDataProvider]] • [[TIpHtmlPanel]] | |
| 75 | + | Chart | [[TChart]] • [[TListChartSource]] [[TRandomChartSource]] • [[TUserDefinedChartSource]] • [[TCalculatedChartSource]] • [[TDbChartSource]] • [[TChartToolset]] • [[TChartAxisTransformations]] • [[TChartStyles]] • [[TChartLegendPanel]] • [[TChartNavScrollBar]] • [[TChartNavPanel]] • [[TIntervalChartSource]] • [[TDateTimeIntervalChartSource]] • [[TChartListBox]] • [[TChartExtentLink]] • [[TChartImageList]] | |
| 76 | + | SQLdb | [[TSQLQuery]] • [[TSQLTransaction]] • [[TSQLScript]] • [[TSQLConnector]] • [[TMSSQLConnection]] • [[TSybaseConnection]] •[[TPQConnection]] • [[TPQTEventMonitor]] • [[TOracleConnection]] • [[TODBCConnection]] • [[TMySQL40Connection]] • [[TMySQL41Connection]] • [[TMySQL50Connection]] • [[TMySQL51Connection]] • [[TMySQL55Connection]] • [[TMySQL56Connection]] • [[TSQLite3Connection]] • [[TIBConnection]] • [[TFBAdmin]] • [[TFBEventMonitor]] • [[TSQLDBLibraryLoader]] | |
| 77 | + | ||
| 57 | 78 | --- | |
| 58 | - | ||
| 79 | + | *From the Free Pascal wiki, page "TScrollBar/de", as the Internet Archive kept it on 2024-09-20, 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).* |
