GUI "SplitButton Demo",

ENUM
    SB_APPLES  
    SB_BANANAS
    SB_GRAPES
    SB_ORANGES
END ENUM

GLOBAL AS HWND Form1, hSplitButt

SUB FORMLOAD
  
    DIM AS BCX_SPLITBUTTONDATA MenuItems[4]
  
    Form1 = BCX_FORM("SplitButton Demo", 0, 0, 300, 200)

    hSplitButt = BCX_SPLITBUTTON("Apples", Form1, SB_APPLES, 10, 10, 100, 25)

    MenuItems[0].szlabel = "Apples"   :  MenuItems[0].nID = SB_APPLES
    MenuItems[1].SZLABEL = "Bananas"  :  MenuItems[1].nID = SB_BANANAS
    MenuItems[2].Szlabel = "Grapes"   :  MenuItems[2].nID = SB_GRAPES
    MenuItems[3].szLabel = "Oranges"  :  MenuItems[3].nID = SB_ORANGES
  
    BCX_SPLITBUTTON_SETITEMS(hSplitButt, ADDRESSOF(MenuItems[0]), 4)
  
    CENTER Form1
    SHOW Form1
END SUB

BEGIN EVENTS
    SELECT CASE CBMSG
    CASE WM_COMMAND
        SELECT CASE CBCTL
        CASE SB_APPLES  : MSGBOX "Apples"
        CASE SB_BANANAS : MSGBOX "Bananas"
        CASE SB_GRAPES  : MSGBOX "Grapes"
        CASE SB_ORANGES : MSGBOX "Oranges"
        END SELECT
    END SELECT
END EVENTS
