Difference between revisions of "TMaskEdit"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "A '''TMaskEdit''' image:tmaskedit.png is a control with a single line of editable text that has to fit to a predefined mass. It is available from the Additional tab of...")
 
(Some more cMask_* values)
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
A '''TMaskEdit''' [[image:tmaskedit.png]] is a control with a single line of editable text that has to fit to a predefined mass. It is available from the [[Additional tab]] of the [[Component Palette]].
+
{{TMaskEdit}}
 +
 
 +
A '''TMaskEdit''' [[image:tmaskedit.png]] is a control with a single line of editable text that has to fit to a predefined 'EditMask'. It is available from the [[Additional tab]] of the [[Component Palette]].
 +
 
 +
The EditMask is formed with a pattern of characters with the following meaning:
 +
{| class="wikitable"
 +
|-
 +
| cMask_SpecialChar    || \ || after this you can set an arbitrary char
 +
|-
 +
| cMask_UpperCase      || > ||  after this the chars is in upper case
 +
|-
 +
| cMask_LowerCase      || < ||  after this the chars is in lower case
 +
|-
 +
| cMask_Letter          || l ||  only a letter but not necessary
 +
|-
 +
| cMask_LetterFixed    || L ||  only a letter
 +
|-
 +
| cMask_AlphaNum        || a ||  an alphanumeric char (['A'..'Z','a..'z','0'..'9']) but not necessary
 +
|-
 +
| cMask_AlphaNumFixed  || A ||  an alphanumeric char
 +
|-
 +
| cMask_AllChars        || c ||  any Utf8 char but not necessary
 +
|-
 +
| cMask_AllCharsFixed  || C ||  any Utf8 char, but NOT SpaceChar
 +
|-
 +
| cMask_Number          || 9 ||  only a number but not necessary
 +
|-
 +
| cMask_NumberFixed    || 0 ||  only a number
 +
|-
 +
| cMask_NumberPlusMin  || # ||  only a number or + or -, but not necessary
 +
|-
 +
| cMask_HourSeparator  || : ||  automatically put the hour separator char
 +
|-
 +
| cMask_DateSeparator  || / ||  automatically put the date separator char
 +
|-
 +
| cMask_Hex            || h ||  a hexadecimal character but not necessary (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_HexFixed        || H ||  a hexadecimal character (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_Binary          || b ||  a binary character but not necessary (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_BinaryFixed    || B ||  a binary character (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_SetStart        || [ ||  Start of a set (if EnableSets = True) (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_SetEnd          || ] ||  End of a set (if EnableSets = True) (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_SetNegate      || ! ||  Negates a set (if it is the first character inside the given set) (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_SetOptional    || <nowiki>|</nowiki> ||  Makes the set optional, so a blank is accepted (if it is the first character inside the given set, and the set is not negated) (Lazarus extension, not supported by Delphi)
 +
|-
 +
| cMask_NoLeadingBlanks || ! || Trim leading blanks, otherwise trim trailing blanks from the data
 +
|}
  
 
==See also==
 
==See also==

Revision as of 13:56, 5 April 2021

English (en) français (fr) русский (ru)

A TMaskEdit tmaskedit.png is a control with a single line of editable text that has to fit to a predefined 'EditMask'. It is available from the Additional tab of the Component Palette.

The EditMask is formed with a pattern of characters with the following meaning:

cMask_SpecialChar \ after this you can set an arbitrary char
cMask_UpperCase > after this the chars is in upper case
cMask_LowerCase < after this the chars is in lower case
cMask_Letter l only a letter but not necessary
cMask_LetterFixed L only a letter
cMask_AlphaNum a an alphanumeric char (['A'..'Z','a..'z','0'..'9']) but not necessary
cMask_AlphaNumFixed A an alphanumeric char
cMask_AllChars c any Utf8 char but not necessary
cMask_AllCharsFixed C any Utf8 char, but NOT SpaceChar
cMask_Number 9 only a number but not necessary
cMask_NumberFixed 0 only a number
cMask_NumberPlusMin # only a number or + or -, but not necessary
cMask_HourSeparator : automatically put the hour separator char
cMask_DateSeparator / automatically put the date separator char
cMask_Hex h a hexadecimal character but not necessary (Lazarus extension, not supported by Delphi)
cMask_HexFixed H a hexadecimal character (Lazarus extension, not supported by Delphi)
cMask_Binary b a binary character but not necessary (Lazarus extension, not supported by Delphi)
cMask_BinaryFixed B a binary character (Lazarus extension, not supported by Delphi)
cMask_SetStart [ Start of a set (if EnableSets = True) (Lazarus extension, not supported by Delphi)
cMask_SetEnd ] End of a set (if EnableSets = True) (Lazarus extension, not supported by Delphi)
cMask_SetNegate ! Negates a set (if it is the first character inside the given set) (Lazarus extension, not supported by Delphi)
cMask_SetOptional | Makes the set optional, so a blank is accepted (if it is the first character inside the given set, and the set is not negated) (Lazarus extension, not supported by Delphi)
cMask_NoLeadingBlanks ! Trim leading blanks, otherwise trim trailing blanks from the data

See also


LCL Components
Component Tab Components
Standard TMainMenu • TPopupMenu • TButton • TLabel • TEdit • TMemo • TToggleBox • TCheckBox • TRadioButton • TListBox • TComboBox • TScrollBar • TGroupBox • TRadioGroup • TCheckGroup • TPanel • TFrame • TActionList
Additional TBitBtn • TSpeedButton • TStaticText • TImage • TShape • TBevel • TPaintBox • TNotebook • TLabeledEdit • TSplitter • TTrayIcon • TControlBar • TFlowPanel • TMaskEdit • TCheckListBox • TScrollBox • TApplicationProperties • TStringGrid • TDrawGrid • TPairSplitter • TColorBox • TColorListBox • TValueListEditor
Common Controls TTrackBar • TProgressBar • TTreeView • TListView • TStatusBar • TToolBar • TCoolBar • TUpDown • TPageControl • TTabControl • THeaderControl • TImageList • TPopupNotifier • TDateTimePicker
Dialogs TOpenDialog • TSaveDialog • TSelectDirectoryDialog • TColorDialog • TFontDialog • TFindDialog • TReplaceDialog • TTaskDialog • TOpenPictureDialog • TSavePictureDialog • TCalendarDialog • TCalculatorDialog • TPrinterSetupDialog • TPrintDialog • TPageSetupDialog
Data Controls TDBNavigator • TDBText • TDBEdit • TDBMemo • TDBImage • TDBListBox • TDBLookupListBox • TDBComboBox • TDBLookupComboBox • TDBCheckBox • TDBRadioGroup • TDBCalendar • TDBGroupBox • TDBGrid • TDBDateTimePicker
Data Access TDataSource • TCSVDataSet • TSdfDataSet • TBufDataset • TFixedFormatDataSet • TDbf • TMemDataset
System TTimer • TIdleTimer • TLazComponentQueue • THTMLHelpDatabase • THTMLBrowserHelpViewer • TAsyncProcess • TProcessUTF8 • TProcess • TSimpleIPCClient • TSimpleIPCServer • TXMLConfig • TEventLog • TServiceManager • TCHMHelpDatabase • TLHelpConnector
Misc TColorButton • TSpinEdit • TFloatSpinEdit • TArrow • TCalendar • TEditButton • TFileNameEdit • TDirectoryEdit • TDateEdit • TTimeEdit • TCalcEdit • TFileListBox • TFilterComboBox • TComboBoxEx • TCheckComboBox • TButtonPanel • TShellTreeView • TShellListView • TXMLPropStorage • TINIPropStorage • TJSONPropStorage • TIDEDialogLayoutStorage • TMRUManager • TStrHolder
LazControls TCheckBoxThemed • TDividerBevel • TExtendedNotebook • TListFilterEdit • TListViewFilterEdit • TLvlGraphControl • TShortPathEdit • TSpinEditEx • TFloatSpinEditEx • TTreeFilterEdit • TExtendedTabControl •
RTTI TTIEdit • TTIComboBox • TTIButton • TTICheckBox • TTILabel • TTIGroupBox • TTIRadioGroup • TTICheckGroup • TTICheckListBox • TTIListBox • TTIMemo • TTICalendar • TTIImage • TTIFloatSpinEdit • TTISpinEdit • TTITrackBar • TTIProgressBar • TTIMaskEdit • TTIColorButton • TMultiPropertyLink • TTIPropertyGrid • TTIGrid
SQLdb TSQLQuery • TSQLTransaction • TSQLScript • TSQLConnector • TMSSQLConnection • TSybaseConnection • TPQConnection • TPQTEventMonitor • TOracleConnection • TODBCConnection • TMySQL40Connection • TMySQL41Connection • TMySQL50Connection • TMySQL51Connection • TMySQL55Connection • TMySQL56Connection • TMySQL57Connection • TSQLite3Connection • TIBConnection • TFBAdmin • TFBEventMonitor • TSQLDBLibraryLoader
Pascal Script TPSScript • TPSScriptDebugger • TPSDllPlugin • TPSImport_Classes • TPSImport_DateUtils • TPSImport_ComObj • TPSImport_DB • TPSImport_Forms • TPSImport_Controls • TPSImport_StdCtrls • TPSCustomPlugin
SynEdit TSynEdit • 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
Chart TChart • TListChartSource • TRandomChartSource • TUserDefinedChartSource • TCalculatedChartSource • TDbChartSource • TChartToolset • TChartAxisTransformations • TChartStyles • TChartLegendPanel • TChartNavScrollBar • TChartNavPanel • TIntervalChartSource • TDateTimeIntervalChartSource • TChartListBox • TChartExtentLink • TChartImageList
IPro TIpFileDataProvider • TIpHtmlDataProvider • TIpHttpDataProvider • TIpHtmlPanel
Virtual Controls TVirtualDrawTree • TVirtualStringTree • TVTHeaderPopupMenu