The MASM Forum

Projects => MasmBasic & the RichMasm IDE => Topic started by: jj2007 on August 03, 2023, 01:09:36 AM

Title: Coloured rounded buttons
Post by: jj2007 on August 03, 2023, 01:09:36 AM
The source:
GuiParas equ "Colourful buttons", w320, h120, icon Butterfly    ; 32% of window width, 12% of height
; GuiButtonPen equ <MakePen MbBtnPen, RgbCol(180, 255, 255, 255), width 9> ; optional: white, half transparent border
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl Button1, "button", "A normal pushbutton", w250, h0+50    ; width 25% of client area, height 0%+40px
  GuiControl Button2, "button", "Lite Turquoise"/"Blue", bcol LiteBlueGreen/Blue, x250, w250, h0+50, font -14
  GuiControl Button3, "button", "Lite Yellow"/"Full Yellow", bcol LiteYellow/Yellow, fcol Red/Black, x500, w250, h600+20, font -14:FW_BOLD
  GuiControl Button4, "button", "Rounded button", bcol Grey/Red, fcol Black/White, rr40, x750, w250, h0+50, font -12:FW_SEMIBOLD
GuiEnd

The result:
(http://www.jj2007.eu/pics/ColouredButtons.png)

Attached two versions, one with the optional GuiButtonPen, one without. They look quite different when pressed ;-)

Building requires MasmBasic of 2 August 2023 (http://masm32.com/board/index.php?topic=94.0)