Forwardglobal Type UO_COMCTL_STATUSBAR from UserObjectnd Typetype Rect from Structure Withnin UO_COMCTL_STATUSBAREEND TYPEEND FORWARD
Type Rect from Structure Long LEFT Long Top Long Right Long Bottomend Type
global type uo_comctl_statusbar from userobjectinteger width = 2213integer height = 284userobjects objecttype = externalvisual! long backcolor = 79741120string classname = "msctls_statusbar32" string libraryname = "comctl32.dll" long style = 1174405376end typeglobal uo_comctl_statusbar uo_comctl_statusbar
type prototypesfunction long SendMessageLong (long hWindow, uint Msg, ulong wParam, Ref long Parts []) Library 'user32' alias for 'SendMessageA'function long SendMessageString (long hWindow, uint Msg, ulong wParam, Ref string szText) Library' user32 ' Alias for 'SendMessagea'Function Long SendMessageRect (Long Hwindow, Uint Msg, Ulong WPARAM, Ref Rect Library' USER32 'Alias FOR' SendMessagea'End Prototype
Type variables // status bar typespublic: constant long sbt_noborders = 256Constant long sbt_popout = 512constant long sbt_rtlreading = 1024constant long sbt_ownerdraw = 4096
// Pop-up message window string is_winmessage
// Status Bar MessagesPrivate: Constant Long WM_USER = 1024Constant Long SB_SETTEXT = (WM_USER 1) Constant Long SB_GETTEXT = (WM_USER 2) Constant Long SB_GETTEXTLENGTH = (WM_USER 3) Constant Long SB_SETPARTS = (WM_USER 4) Constant Long SB_GETPARTS = (WM_USER 6) Constant Long SB_GetBorders = (WM_USER 7) Constant Long SB_SETMINHEIGHT = (WM_USER 8) Constant Long SB_SIMPLE = (WM_USER 9) Constant Long SB_GETRECT = (WM_USER 10) End Variables
forward prototypespublic subroutine of_gettext (readonly integer aipart, ref string astext) public function long of_getparts (ref long alparts []) public function boolean of_setparts (long alparts []) public subroutine of_setminheight (readonly long alMinHeight) public function integer of_gettextlength (readonly long alpart ) public function boolean of_getrect (readonly long alPart, ref long alTop, ref long alLeft, ref long alRight, ref long alBottom) public function boolean of_settext (readonly integer aipart, readonly integer aistyle, string astext) public function boolean of_getborders (ref long alhorizontalwidth , Ref long alserticalwidth, integer alseperatorwidth
Public Subroutine of_Gettext (Readonly Integer Aipart, Ref string astext); / / ===================================== =================================================================================================================================================】 // ------ -------------------------------------------------- ----------- // Description: The sb_gettext message retrieves the text from the // specified part of a status window. // ---------------- -------------------------------------------------- - // Parameters: wparam = (wparam) iPart // lparam =
(LPAM) (LPSTR) SZText //// ipart // Zero-Based Index of the Part from Which To Retrieve Text. // Sztext // PoinTer To The Buffer That Receives The Text. // This Parameter Is A Null-Terminated String. // ---------------------------------------------- --------------------- // Returns: Returns A 32-Bit Value That Consists of Two 16-Bit Values. // The Low Word Specifier The Length, in Characters, of the text.// The high word specifies the type of operation used to // Draw the text. The Type Can Be One of the follue means // -------- ------------------------------------------------ ---- // 0 The Text Is Drawn with a border to Appear Lower // Than The Plane of the TEXT IS DRAWN WITHOUT BORDERS. // SBT_POPOUT The Text Is Drawn with a Border To Appear Higher / / Than the plane of window. // sbt_rtlreading displays text Using right-to-left il // on Hebrew or Arabic Systems. ////Iff i i h The SBT_OWNERDRAW DRAWING TYPE, this Message // Returns the 32-bit value associated with the text instead of // the length-------------------- ------------------------------------ // 1997 Microsoft Corporation. All rights reserved./ /======================================= ==================================== // allocate space for bufferastext = Space (255)
SendMessageString (Handle (this), SB_Gettext, Aipart, ASTEXT
Return
End subroutine
Public function long of_getparts (Ref long alparts []); // ===================================== ======================================== // function: UO_STATUSBAR :: of_getparts () // ------- -------------------------------------------------- -------- // Description: The SB_GetParts Message Retrieves a count of the // parts in a status window. The message also retrieves /// Coordinate of the right edge of the specified // number of parts . ------------------------------------------------------------------------------------------------------- -------------------- // Parameters: wparam = (wparam) nparts // lparam =
(LPARAM) (LPINT) aRightCoord //// nParts // Number of parts for which to retrieve coordinates. // If this parameter is greater than the number of parts in the // window, the message retrieves coordinates for existing parts only. // aRightCoord // Pointer to an integer array that has the same number of elements // as parts specified by nParts. Each element in the array receives // the client coordinate of the right edge of the corresponding part. // If an element IS set to - 1, The position of the right Edge for // That Part extends to the right edge of the window. to retrieve // the current number of parts, set this parameter to zero. // ---------- -------------------------------------------------- ----------- // Returns: returns the number of parts in the window if successful, // or zero Otherwise. // ---------------- -------------------------------------------------- - /? 1997 Microsoft Corporation. All rights reserved. / /==================================== ============================== == long llcountparts, llindexlong llparts128 [128], llparts [] // allocate memory for unbouded Array Before calling API function.llparts [] = llparts128 []
// Get All of the parts.llcountparts = sendMessagelong (Handle (this), SB_GETPARTS, UPPERBOUND (LLPARTS), LLPARTS [])
IF (llcountparts> 0) THEN / ARRAY Assignment Will Copy All 128 Elements, Which is undesirable. For llindex = 1 to llcountparts alparts [llindex] = llparts [llindex] NEXTEND IF
Return LlcountPartsend Function
Public function boolean of_setparts (long alphats []); // ======================================= ======================================= // Function: UO_STATUSBAR :: of_setparts () // -------- -------------------------------------------------- --------- // Description: The SB_SETPARTS Message Sets the number of parts // in a status window and the coordinate of the right // Edge of Each Part. // ---------------------------------------------------------------------- -------------------------------------------------- -------- // Parameters: wparam = (wparam) nparts // lparam = (lpint) awidths //// nparts // number of parts to set. The number of parts cannot be greater // than 255. // aWidths // Pointer to an integer array that has the same number of // elements as parts specified by nParts. Each element in the // array specifies the position, in client coordinates, of the // right Edge of the corresponding part. if an element is - 1, // the position of the right Edge for That Part extends to the // Right Edge of the window. // ------------- ------------ -------------------------------------------- // Returns: if the Operation successmeds, the return value is true. //iff value is false. // --------------------------------------------------------------------------------------------------------------- ----------------------------------------- //? 1997 Microsoft Corporation. All Rights Reserved. //======================================
============================== l llcountpartsboolean lbsetparts = falsellcountparts = UpperBound (alparts [])
IF llcountparts> 0 Then lbsetparts = (SendMessagelong (Handle (this), SB_SETPARTS, LLCOUNTPARTS, Alparts []) <> 0) end if
Return LBSETPARTS
END FUNCTION
Public subs (readonly long alminhem); / / ======================================= ============================ // Function: UO_STATUSBAR :: of_setminHeight () // ---------- -------------------------------------------------- ------- // Description: The Sb_SETMINHEIGHT MESSAGE STATUS WINDOW 抯 Drawing area. /// Note: The minimum height is the sum of wparam and twice the width, // in pixels, of the vertical border of the status window.// An application must send the WM_SIZE message to the status // window to redraw the window. The wParam and lParam parameters // of the WM_SIZE message should be set to zero. // -------------------------------------------------- ----------------- // Parameters: wparam = (wparam) Minheight // LParam = 0 ////mHeight // Minimum Height, In Pixels, of the window. / / --------------------------------------------------- ------------------ // Returns:
Return
End subrutinepublic function integer of_gettextLength (readonly long alpha); / / ===================================== ====================================== // function: UO_STATUSBAR :: of_gettextLength () // ------------ -------------------------------------------------- --------- // Description: The sb_gettextLength Message Retrieves the length, // in character, of the text from the specified part // of a status window. // --------- -------------------------------------------------- -------- // Parameters: wparam = (wparam) iPart // lparam =
0 /// ipart // zero-based index of the part from which to retrieve text. // -------------------------- ---------------------------------------- // Returns: Returns a 32-bit value THE CONSISTS OF TWO 16-BIT VALUES. // THE THE THE TO DRAW // Thepe Operation Used to draw // The text. The Type Can Be One of the FOLLOWING VALUES: //// Value Meaning // ------------------------------------- ------------------------- // 0 The text is drawn with a border to Appear Lower // Than THE PLANE OF THE WINDOW. // SBT_NOBORDERS The text is drawn without borders. // SBT_OWNERDRAW The text is drawn by the parent window. // SBT_POPOUT The text is drawn with a border to appear higher // than the plane of the window. // SBT_RTLREADING Displays text using right-to -Left Reading Order // on Hebrew or Arabic Systems. // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------- //? 1997 microso ft corporation. All rights reserved. //============================================= ========================== l lllengthllength = send (Handle (this), sb_gettextLength, alpart, 0)
Return Intlow (LLLLENGTH)
END FUNCTION
Public Function Boolean of_getRect (Readonly Long Alpart, Ref Long Altop, Ref Long Alleft, Ref Long Alright, Ref Long Albottom); / / ====================== ====================================================== // Function: UO_STATUSBAR :: of_getrect () // ----------------------------------------- ------------------------ // Description: The Sb_GetRect Message Retrieves the bounding // Rectangle of a part in a status window. // --- -------------------------------------------------- -------------- // Parameters: wparam = (wparam) iPart // lparam = (lprect) lprc /// ipart // zero-based index of the part whose Bounding rectangle is to be // retrieved. // lprc // Pointer to a rect standing recture.//----------------------- -------------------------------------------- // Returns: if the Operation successmeds, the return value is true. //iff value is false. // --------------------------------------------------------------------------------------------------------------- ----------------------------------------- //? 1997 MIC Rosoft corporation. all rights reserved. / /========================================== ========================== Boolean lbgetRect = FalseRect LRECT
LBGETRECT = (Handle (this), SB_GETRECT, Alpart, LRECT) <> 0) if LBGETRECT THEN ALTOP = LRECT.TOP AlLeft = LRECT.LEFT AlRight = LRECT.Right Albottom = LRECT.BOTTMEND IF
Return LBGETRECT
END FUNCTION
Public Function Boolean of_Settext (Readonly Integer AIPART, Readonly Integer AiTyle, String Astext); / / =============================== ============================================= // Function: UO_STATUSBAR :: of_setText () // -------------------------------------------------- --------------- // Description: The Sb_Settext Message Sets The text in the specified // Part of a status window. // the message invalidates the portion of the window there // HAS Changed, causing it to display the new text when // the window next receiver. // ---------------------------------------------------------------------------------------------------------- --------------------------------------- // Parameters: wparam = (wparam) iPart | Utype // lparam =
(LPSTR) sztext //// ipart // zero-based index of the part value is 255, // the status window is assoclyd to beam one part. / / uType // type of drawing operation. // this parameter can be one of the folload value: //// value meaning // -------------- ------- ------------------------------------------- // 0 The text is Drawn with a border to appear lower // than the plane of the window. // SBT_NOBORDERS The text is drawn without borders. // SBT_OWNERDRAW The text is drawn by the parent window. // SBT_POPOUT The text is drawn with a border to appear higher // than the plane of the window. // SBT_RTLREADING Displays text using right-to-left reading order // on Hebrew or Arabic systems. // szText // Pointer to a null-terminated string that specifies the text to set. / / If utype is sbt_ownerdraw, this parameter represents 32 bits of // data. The Parent Window Must Interpret The Data and Draw The Text //En it receives the wm_drawitem message. // --------------------------------------- ---------------------------- // Returns: if the operation succeeds, the return value is true. //Iff the operation fails, The return value is false. // ------------------------------------------ ------------------------- //? 1997 Microsoft Corporation. All rights reserved. //============ ============================================================================================================================================================================================================= =====
Return (SendMessageString (Handle (this), SB_SETTEXT, AIPART AISTYLE, ASTEXT <> 0) End Function
Public Function Boolean of_GetBorders (Ref Long Alvertagewidth, INTEGER AlseperatorWidth); / / =============================== ============================================= // Function: UO_STATUSBAR :: of_getparts () // - -------------------------------------------------- --------------- // Description: The Sb_GetBorders Message Retrieves The Current // Widths of The Horizontal and Vertical Borders of A // Status Window. //// Note: The Borders Determine THE SPACING BETWEEN THE OUTGE / / / OF THE WINDOW AND THE // Contain Text. // The Borders Also Determine The Spacing Between Rectangles. // ---------------- -------------------------------------------------- --- // Parameters: wparam = 0 // lParam = (lpint) ABORDERS; /// Aborders // PoinTer to an integer array That Has Three Elements. // The First Element RECEIVES The Width of the Horizontal Border, // The second receiver, // and the th Ird receives the width of the border between rectangles. // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------- // Returns: if The Operation successmeds, the return value is true. //Iff the Operation Fails , the return value is false. // ----------------------------------------- -------------------------- //? 1997 Microsoft Corporation. All rights reserved. //=========== =========
=============================================== l llborders [ ] Boolean LbgetBorders = false // Initialise Unbounded Array to Correct Size.llborders [3] = 0llborders [2] = 0llborders [1] = 0
LbgetBorders = (SendMessagelong (Handle (this), SB_GetBorders, 0, Llborders [] <> 0)
If LBGETBORDERS THEN alhorizontalwidth = llborders [1] alverticalwidth = llborders [2] alseperatorwidth = llborders [3] endiff
Return LbgetBorders
END FUNCTION
Public function boolean of_setsimple (readonly boolean absimple); / / ======================================= ============================= // function: UO_STATUSBAR :: of_setsimple () // --------- -------------------------------------------------- -------- // Description:. The SB_SIMPLE message specifies whether a status // window displays simple text or displays all window // parts set by a previous SB_SETPARTS message //// NOTE: If the status window is BEING CHANGED from nonsimple to // simple, or vice versa, the window is immediately redrawn. // ----------------------------- -------------------------------------- // Parameters: wparam = (wparam) (bool) FSIMPLE / / LPARAM = 0 //// fsimple // Display Type Flag. if this parameter is true, The window // displays Simple text. if it is false, it displays // multiple parts. // ----- -------------------------------------------------- ------------ // Returns: returns true if set was successful.// Returns false if an error occurs. // --------------- -------------------------------------------------- - //? 1997 Microsoft Corporation. All rights reserved. / /=================================== ================================= l llsimple
// convert Boolean to 'c' style boolean (non-zero = true) if absimple kil = 1ELSE llsimple = 0nd iFreturn (Handle (THIS), SB_SIMPLE, LLSIMPLE, 0)> 0)
END FUNCTION
ON UO_COMCTL_STATUSBAR.CREATEEND ON
ON UO_COMCTL_STATUSBAR.DESTROYEND ON
Event rbuttondown; if is_winmentage = '' TEN RETURN
WINDOW W_MESS
Open (w_mess, is_winmessage) End Event