home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / bidi / arabic / style / readme < prev    next >
Text File  |  1999-05-11  |  11KB  |  230 lines

  1.  
  2.  
  3. The STYLE application provided here is built as an 'extension' of
  4. the OS/2 2.0 STYLE Toolkit sample. The 'extenstions' are related
  5. to work with bidirectional languages.
  6.  
  7. The following is a description of the bidirectional extensions that
  8. have been implemented in STYLE.
  9.  
  10. 1)  Client Area
  11.  
  12.     The client area (client window) of STYLE is divided into two parts:
  13.     In the upper part a few text strings are displayed. Each one of them
  14.     is displayed using OS/2 APIs.
  15.     The strings on the left, are always readable because the program
  16.     disables the GPI bidirectional support for them.
  17.     The string on the right side are affected by the process bidi attributes
  18.     that are in effect for Style.
  19.  
  20.     Disabling and enabling the GPI support is done with the
  21.     GpiSetBidiAttr() function, in sty_pnt.c.
  22.  
  23.     For example, if STYLE is run in a session where the environment
  24.     contains:   SET BIDIATTR=TEXTTYPE_VISUAL, TEXT_ORIENT_RTL,
  25.     then the strings on the right side will be simply reversed.
  26.  
  27.     The last row in the client area will show the last text that
  28.     was queried from the clipboard. It may be useful for looking
  29.     at the actual clipboard text, when using Paste with No Conversion.
  30.  
  31.  
  32. 2)  File
  33.  
  34.       Open
  35.         In: sty_file.c, FileOpen().
  36.         The File->Open dialog comes up in the National Language
  37.         (i,e not in English) and is right-justified.
  38.         This is a result of setting the FDS_NATIONAL_LANGUAGE
  39.         flag in the FileDlg structure.
  40.  
  41.       Save and Save as... -
  42.              In sty_file.c, FileSave() and FileSaveAs().
  43.              No code changes have been implemented. However, if the
  44.              STYLE program is run when 'SET STDDLGLANG=NATIONAL'
  45.              is defined in the environment, these dialogs will come
  46.              up Right-To-Left and inthe National Language.
  47.  
  48. 3)  Edit
  49.  
  50.       In file sty_edit.c.
  51.  
  52.       Copy   This shows a few techniques of Copying (or cutting)
  53.              bidirectional text to the PM clipboard.
  54.  
  55.              No Conversion   - The text is copied to the clipboard.
  56.                                the clipboard is put in 'no conversion' state.
  57.                                When pasted to a requesting application
  58.                                the text will be pasted 'as is'.
  59.              Auto Conversion - The text is copied to the clipboard.
  60.                                The process bidi attributues of STYLE is
  61.                                used as the bidi attributes of the text
  62.                                that was copied. When the clipboard text
  63.                                will be converted (as part of the paste
  64.                                operation) to another application, the
  65.                                Process Bidi Attributes of STYLE will be
  66.                                used as the 'source' bidi attributes.
  67.              Copy Visual       The text is copied to the clipboard.
  68.                                The clipboard text is marked as having
  69.                                Visual Texttype.
  70.                                Visual texttype will be used as the
  71.                                source bidi attribtues when the text
  72.                                will be pasted to a requesting application.
  73.              Copy Implicit     The text is copied to the clipboard.
  74.                                The clipboard text is marked as having
  75.                                Implicit Texttype.
  76.                                Implicit texttype will be used as the
  77.                                source bidi attribtues when the text
  78.                                will be pasted to a requesting application.
  79.  
  80.       Paste  This shows a few techniques of querying data from the clipboard.
  81.  
  82.              No Conversion     The text, as stroed in the clipboard, is
  83.                                copied to the application buffer, with
  84.                                NO text conversion (i.e, as is).
  85.              Auto Conversion   The clipboard text is converted accoriding
  86.                                to the Process Bidi Attributes of the
  87.                                requesting application (STYLE, in this case).
  88.              Paste Visual      The clipboard text is converted to VISUAL
  89.                                as part of the WinQueryClipbrd() operation.
  90.              Paste Implicit    The clipboard text is converted to IMPLICIT
  91.                                as part of the WinQueryClipbrd() operation.
  92.  
  93.  
  94. 4) Options --> Font
  95.  
  96.             No Code Change.
  97.             The font dialog should come up Right-To-Left and in the
  98.             National Lanauge if the environment variable
  99.             'SET STDDLGLANG=NATIONAL' is in effect.
  100.  
  101.             Note: you can explicitly set the font dialog to
  102.             the national Language also bu setting the
  103.             FNTS_NATIONAL_LANGUAGE) style flag in the FONTDLG structure.
  104.  
  105.  
  106. 5) Controls
  107.  
  108.        Dialog Controls:
  109.  
  110.               Buttons - The whole dialog comes up in Right-To-Left
  111.                         orientation. All the child controls are also
  112.                         right-to-left.
  113.                         This is a result of using BIDIPARAMs in the
  114.                         resource file.
  115.  
  116.               Listboxes - The listbox dialog is not right-to-left. but
  117.                         the listboxes themselves are dynamically set to have
  118.                         right to left window orientation using
  119.                         the WinSetLangInfo() API.
  120.                         Some listboxes have visual text. Some have
  121.                         Implicit text.
  122.                         You can see that the national text is sorted
  123.                         correctly when the text is implicit, and is sorted
  124.                         incorrectly when the text is visual.
  125.                         In file: sty_dlg.c, routine: LoadListBox().
  126.  
  127.  
  128.               Combobox - The combobox dialog is not right-to-left.
  129.                         The simple combobox is set to visual and to
  130.                         right-to-left window orientation.
  131.                         The other comboboxes are set to Implicit text
  132.                         and right-to-left window orientation.
  133.  
  134.  
  135.               Single-Line Entry Field - The dialog is set to Right-To-Left
  136.                         window orientation.
  137.                         The entry fields themselves are set, in the
  138.                         dialog template (in sty_main.dlg) as follows:
  139.                         The first Entry Field is set to Visual text
  140.                         and left-to-right window orientation.
  141.                         The second Entry Field is set to Visual text
  142.                         and right-to-left window orientation.
  143.                         The third and forth entryfields are set to
  144.                         Implicit text, contextual orientation, and
  145.                         left to right window orientation.
  146.  
  147.               Multi-Lines Entry Field -
  148.                         The first MLE is set to Visual text, right-to-left
  149.                         window orientation.
  150.                         The first MLE is set to Implicit text, right-to-left
  151.                         window orientation.
  152.  
  153.               Static -  The whole dialog is set to Right-to-left window
  154.                         orientation.
  155.  
  156.               CUA Controls:
  157.  
  158.               Sliders - Both sliders are set to right-to-left
  159.                         window orientation, dynamically.
  160.                         This is done in sty_dlg.c (InitializeSlider()).
  161.  
  162.               Spin Buttons - both spinbuttons are set to right-to-left
  163.                         window orientation, dynamically.
  164.                         This is done in sty_dlg.c (InitializeSpinButton()).
  165.  
  166.  
  167.               Notebook - The notebook and the page windows are dynamically
  168.                          set to have right-to-left window orientation.
  169.                          This is done in sty_dlg.c (InitializeNotebook()).
  170.                          Also, the strings of the notebook are displayed
  171.                          in the appropriate language.
  172.  
  173.               Value Set - The value set window is set to right-to-left
  174.                          order using the VS_RIGHTOLEFT style.
  175.                          In addition, the first item is set to have
  176.                          a TEXT style, and a text orientation of
  177.                          right-to-left. As a result, it is displayed
  178.                          with it text inverted.
  179.  
  180.               Container - The container is set to right-to-left window
  181.                          orientation and to Implicit text, dynamically,
  182.                          in sty_dlg.c (InitializeContainer()).
  183.  
  184.                          As a result, the container items (records)
  185.                          are right justified.
  186.                          You may want to change view of the container.
  187.                          You can do this by clicking with the right mouse
  188.                          button on the container and selecting a view.
  189.                          All views will be Right-To-Left.
  190.                          You can also dynamically edit the text of each
  191.                          of the icons by pressing the left mouse button
  192.                          when the ALT key is pressed. Editing will be
  193.                          in the natural language (i.e, right-to-left
  194.                          if in Arabic and Left-to-right if
  195.                          the text is in English).
  196.  
  197.                          Note that in Details view, the first column
  198.                          (on the right) has right-to-left window orientation
  199.                          so that it is right-justified, and the second
  200.                          column (on its left) has left-to-right
  201.                          window orientation and is left-justified.
  202.                          This is done by sending the  CM_SETFIELDBIDIATTR
  203.                          message.
  204.  
  205.        Message Controls: No code changes.
  206.                          When the 'SET STDDLGLANG=NATIONAL' environment
  207.                          variable is defined, all messagebox are
  208.                          right-to-left and the text in the push buttons
  209.                          is displayed in the national language.
  210.  
  211.                          NOTE, when the MessageBox has right-to-left
  212.                          window orientation, the MessageBox also comes
  213.                          up right-to-left. You can try this by inversing
  214.                          the frame window (see 'Menu' below), and then
  215.                          bring up a MessageBox.
  216.  
  217. 6)  Menu                 This shows a few examples of creating menus.
  218.                          The 'Inverse Window' items will reverse the
  219.                          window orientation of the frame window (and
  220.                          as a result, the titlebar and the menu).
  221.  
  222.  
  223.  
  224. 7) Text Transform        Shows the interface to the LayoutTransform()
  225.                          API, for transformations of bidirectional text.
  226.                          in sty_user.c, TransformText().
  227.  
  228.  
  229.  
  230.