[ Pobierz całość w formacie PDF ]
.These languages are termed bi-directional (BiDi) because of this separation.The mostcommon bi-directional languages are Arabic and Hebrew, although other MiddleEast languages are also bi-directional.TApplication has two properties, BiDiKeyboard and NonBiDiKeyboard, that allow youto specify the keyboard layout.In addition, the VCL supports bi-directionallocalization through the BiDiMode and ParentBiDiMode properties.Note Bi-directional properties are not available for cross-platform applications.BiDiMode propertyThe BiDiMode property controls the reading order for the text, the placement of thevertical scrollbar, and whether the alignment is changed.Controls that have a textproperty, such as Name, display the BiDiMode property on the Object Inspector.The BiDiMode property is a new enumerated type, TBiDiMode, with four states:bdLeftToRight, bdRightToLeft, bdRightToLeftNoAlign, and bdRightToLeftReadingOnly.Note THintWindow picks up the BiDiMode of the control that activated the hint.17-4 Devel oper  s Gui de I n t e r n a t i o n a l i z i n g a p p l i c a t i o n sbdLeftToRightbdLeftToRight draws text using left to right reading order.The alignment and scrollbars are not changed.For instance, when entering right to left text, such as Arabic orHebrew, the cursor goes into push mode and the text is entered right to left.Latintext, such as English or French, is entered left to right.bdLeftToRight is the defaultvalue.Figure 17.1 TListBox set to bdLeftToRightbdRightToLeftbdRightToLeft draws text using right to left reading order, the alignment is changedand the scroll bar is moved.Text is entered as normal for right-to-left languages suchas Arabic or Hebrew.When the keyboard is changed to a Latin language, the cursorgoes into push mode and the text is entered left to right.Figure 17.2 TListBox set to bdRightToLeftbdRightToLeftNoAlignbdRightToLeftNoAlign draws text using right to left reading order, the alignment isnot changed, and the scroll bar is moved.Figure 17.3 TListBox set to bdRightToLeftNoAlignbdRightToLeftReadingOnlybdRightToLeftReadingOnly draws text using right to left reading order, and thealignment and scroll bars are not changed.Figure 17.4 TListBox set to bdRightToLeftReadingOnlyParentBiDiMode propertyParentBiDiMode is a Boolean property.When True (the default) the control looks to itsparent to determine what BiDiMode to use.If the control is a TForm object, the formuses the BiDiMode setting from Application.If all the ParentBiDiMode properties areTrue, when you change Application s BiDiMode property, all forms and controls in theproject are updated with the new setting.Cr eat i ng i nt er nat i onal appl i c at i ons 17-5 I n t e r n a t i o n a l i z i n g a p p l i c a t i o n sFlipChildren methodThe FlipChildren method allows you to flip the position of a container control schildren.Container controls are controls that can accept other controls, such asTForm, TPanel, and TGroupBox.FlipChildren has a single boolean parameter, AllLevels.When False, only the immediate children of the container control are flipped.WhenTrue, all the levels of children in the container control are flipped.Delphi flips the controls by changing the Left property and the alignment of thecontrol.If a control s left side is five pixels from the left edge of its parent control,after it is flipped the edit control s right side is five pixels from the right edge of theparent control.If the edit control is left aligned, calling FlipChildren will make thecontrol right aligned.To flip a control at design-time select Edit|Flip Children and select either All orSelected, depending on whether you want to flip all the controls, or just the childrenof the selected control.You can also flip a control by selecting the control on the form,right-clicking, and selecting Flip Children from the context menu.Note Selecting an edit control and issuing a Flip Children|Selected command doesnothing.This is because edit controls are not containers.Additional methodsThere are several other methods useful for developing applications for bi-directionalusers.Table 17.2 VCL methods that support BiDiMethod DescriptionOkToChangeFieldAlignment Used with database controls.Checks to see if thealignment of a control can be changed [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • angela90.opx.pl