The following methods are used to display text dynamically in a window area and to modify the state of a device context. See GetWindowDC, GetDC, and GetButtonDC for information on how to retrieve a device context.
>>-aBaseDialog~Write(--xPos--,--yPos--,--text----------------------------------> >--+------------------------------------------------------------------------+--> | +-"SYSTEM"-+ | +-,--+----------+--+---------------------------------------------------+-+ +-fontName-+ | +-10-------+ | +-,--+----------+--+------------------------------+-+ +-fontSize-+ | +-----------------+ | | V +-OPAQUE------+ | | +-,--"----+-THIN--------+-+--"-+ +-EXTRALIGHT--+ +-LIGHT-------+ +-MEDIUM------+ +-SEMIBOLD----+ +-EXTRABOLD---+ +-BOLD--------+ +-HEAVY-------+ +-UNDERLINE---+ +-ITALIC------+ +-STRIKEOUT---+ +-TRANSPARENT-+ +-CLIENT------+ >--)--------------------------------------------------------------------------><
The Write method enables you to write text to the dialog in the given font and size, to the given position. This method does not take a handle or an ID; it always writes to the dialog window.
See WriteToWindow for a description of the other arguments.
>>-aBaseDialog~ScrollText(--hwnd--,--text--,--+----------+--,--+----------+--> +-fontName-+ +-fontSize-+ >--,--+--------------------------+-------------------------------------------> | +----------------+ | | V | | +-"----+-THIN-------+-+--"-+ +-EXTRALIGHT-+ +-LIGHT------+ +-MEDIUM-----+ +-SEMIBOLD---+ +-EXTRABOLD--+ +-BOLD-------+ +-HEAVY------+ +-UNDERLINE--+ +-ITALIC-----+ +-STRIKEOUT--+ >--,--displaceY--,--step--,--sleep--,--color--)-----------------------------><
The ScrollText method scrolls text in a window with the given size, font, and color. The text is scrolled from right to left. If the method is started concurrently, call it a second time to stop scrolling.
The arguments are:
The handle of the window in which the text is scrolled
A text string that is scrolled
The vertical displacement of the text relative to the top of the window's client area (default 0)
The size of one step in screen pixels (default 4)
The time in milliseconds that the program waits after each movement (default 10). This determines the speed.
The color of the text (default 0, black)
See WriteToWindow for a description of the other arguments.
The following example scrolls the string "Hello world!" from left to right within the given window. The text is located two pixels below the top of the client area, one move is 3 screen pixels, and the delay time after each movement is 15 ms.
MyDialog~ScrollText(hwnd, "Hello world!", , , , 2, 3, 15)
Note: Only one sleep interval can be set for multiple scrolling texts within one process. All scrolling text in one process is synchronized with the first given interval.
>>-aBaseDialog~ScrollInButton(--id--,--text--,--+----------+--,--> +-fontName-+ >--+----------+--,--+--------------------------+----------------> +-fontSize-+ | +----------------+ | | V | | +-"----+-THIN-------+-+--"-+ +-EXTRALIGHT-+ +-LIGHT------+ +-MEDIUM-----+ +-SEMIBOLD---+ +-EXTRABOLD--+ +-BOLD-------+ +-HEAVY------+ +-UNDERLINE--+ +-ITALIC-----+ +-STRIKEOUT--+ >--,--displaceY--,--step--,--sleep--,--color--)---------------><
The ScrollInButton method scrolls text within a button. It is similar to the ScrollText method, except that you have to pass an ID instead of a window handle.
>>-aBaseDialog~ScrollButton(--id--,--xPos--,--yPos--,--left--,--top--> >--,--right--,--bottom--)-------------------------------------><
The ScrollButton method moves the rectangle within a button. It is used to move bitmaps within buttons.
The arguments are:
The ID of the button
The new position of the rectangle (in pixels)
The extension of the rectangle
+-1--------+ >>--aBaseDialog~SetItemFont(--id--,--fonthandle--,--+----------+--)-->< +--redraw--+
The SetItemFont method changes the font for a particular dialog item.
The best place to call this method is within InitDialog. If the font is no longer needed, for instance, when the dialog is closed or another font has been assigned to the dialog item, you should free the font resource by calling DeleteFont. A good place to do this is the Leaving method.
The arguments are:
The ID of the dialog item.
The handle returned by CreateFont.
Do not redraw the item.
Redraw the item, which is the default.
The following example sets a 12-point Arial font for item 101.
::method InitDialog . . . hFont=self~CreateFont("Arial",12) self~SetItemFont(101,hFont,0)