Buttons


Buttons can operate either as a standard push button or as a toggle button where the button will appear pressed down after one click but is restored after a second click. Buttons can have text OR pictures on their faces. Combinations of the 2 are possible with FlatToolbars but ARWEN doesn't support this yet, sorry. It is still possible to have 'text' on the face of a picture button but only if the bitmap image on the face of that button has been drawn with text in it. When a button is created the 'face' parameter (see above) will contain either a text string or a bitmap handle depending on which type is being created. This parameter can be set to NULL if desired. Buttons or ToggleButtons can have their title text altered with: setText(BUTTON, "sometext") PictureButton & TogglePictureButton can have their face image altered with:

    void = sendMessage(id, BM_SETIMAGE, IMAGE_BITMAP, hBitmap) -- hbitmap is the hWnd of a bitmap
When a button is clicked a WM_COMMAND message is (eventually) sent to the handler. It is best not to try to use any other message to detect mouse clicks for Buttons. An application can determine a button's state by sending it a BM_GETCHECK or BM_GETSTATE message; the application can set a button's state by sending it a BM_SETCHECK or BM_SETSTATE message.