BCX Mini Form Designer first try out

Started by djsb, November 29, 2022, 10:18:28 AM

Previous topic - Next topic

djsb

Kevin,
Many thanks for the help. The code you have shared is interesting, and I will study it closely.

Jeff and Doyle,

I will try your suggestions as well, so I can understand what does what in the code.

Thanks again.

David.

mekanixx

Quote from: djsb on November 29, 2022, 12:03:02 PM
Thanks for your replies. Please find attached the .bmf file.

Click on the frame window to select it. Then right click and delete the frame window. This leaves the window how I think you want it.

Maybe?
Doyle

MrBcx

David,

The code below was generated mostly using the left and right sides of my devious brain, not using BMFD.

It shows how to build a lot of your interface using compact loops instead of dozens of lines of eye blurring code.

It also shows how to determine whether a box is checked without ever needing to store a window handle
for any of the checkboxes.

I didn't try to recreate your entire template, I'll leave that to you. I believe I've given you some
good ideas and some useful code to learn from and to use in your project.   See attached screenshot.


GUI "Form1", PIXELS

GLOBAL Form1 AS HWND
GLOBAL Butt  AS CONTROL

SUB FORMLOAD()
    DIM x_pos = 15
    Form1 = BCX_FORM("Form1", 0, 0, 850, 400)
    Butt = BCX_BUTTON("Run Test ...", Form1, 13579, 10, 100)

    BCX_GROUP("Low32", Form1, 5, 5, 10, 825, 55)

    FOR INT i = ID_Chk31 TO ID_Chk00 STEP -1
        BCX_LABEL("S" + STR$(i-WM_APP, 1), Form1, 0, x_pos, 25)
        INCR x_pos, 25
    NEXT

    x_pos = 17
    FOR INT i = ID_Chk31 TO ID_Chk00 STEP -1
        BCX_CHECKBOX(SPC$, Form1, i, x_pos, 40)
        INCR x_pos, 25
    NEXT

    CENTER(Form1)
    SHOW(Form1)
END SUB



BEGIN EVENTS
    SELECT CASE CBMSG
        CASE WM_COMMAND
        SELECT CASE CBCTL
            CASE 13579  : CALL Demo
        END SELECT
    END SELECT
END EVENTS



SUB Demo
    DIM Tmp$
    FOR INT i = ID_Chk31 TO ID_Chk00 STEP -1
        IF (SendMessage(GetDlgItem(Form1, i), BM_GETCHECK, 0, 0) = BST_CHECKED) THEN Tmp$ = Tmp$ + STR$(i-WM_APP) + CRLF$
    NEXT
    Tmp$ = "These are CHECKED:" + CRLF$ + Tmp$
    MSGBOX Tmp$
END SUB




ENUM
    ID_Chk00 = WM_APP
    ID_Chk01
    ID_Chk02
    ID_Chk03
    ID_Chk04
    ID_Chk05
    ID_Chk06
    ID_Chk07
    ID_Chk08
    ID_Chk09
    ID_Chk10
    ID_Chk11
    ID_Chk12
    ID_Chk13
    ID_Chk14
    ID_Chk15
    ID_Chk16
    ID_Chk17
    ID_Chk18
    ID_Chk19
    ID_Chk20
    ID_Chk21
    ID_Chk22
    ID_Chk23
    ID_Chk24
    ID_Chk25
    ID_Chk26
    ID_Chk27
    ID_Chk28
    ID_Chk29
    ID_Chk30
    ID_Chk31
END ENUM


djsb

Thanks for your replies. Please find attached the .bmf file.

Jeff

#3
Hi David,

It has admittedly been a while since I've used the form designer, but I think you can get rid of the "Frame" object.  Also, I believe the grid in the designer represents the drawing area of the main form.  So try reducing that to the size you want your program window to be.

I agree with Kevin, though, and the .bmf file would be helpful here.

Jeff

Edit: The main form might be maximized in the designer.  Check attached pics.

MrBcx

David,

Hopefully you saved your project as a *.bmf file that you can also share with us?

That would make troubleshooting / experimenting much easier.

I'll check back later ... doing outside chores today.

Thanks

djsb

#1
I've had a go at the latest BCX Mini form designer and have made a basic layout (see attached screenshot). However, I am only interested in the frame with the 64 checkboxes, the two buttons and the 4 edit boxes. When I generate the code I get the attached code (LCD_MAPPER1.TXT)


I get lines of code for 68 checkboxes when I only see 64. Maybe there are some hidden or duplicated somewhere that I can see. The extra lines are easily edited out, so that's not a problem. However, when I convert to C and then compile the code I get a LARGE square window with controls in the corner (and some of the checkboxes misplaced or missing) and no border and then a smaller rectangle with NONE of the controls on it. I want the controls in the small rectangle, and I DON'T need the bigger rectangle. I'm a bit confused between a FRAME and a FORM. Probably a beginners mistake, but can someone put me right. Thanks.

David.

PS Can anyone suggest a better way of laying out the checkboxes so that there is room for better placed labels. I'd like to be able to see for example S0 for the first checkbox and then S1 and so on. I suppose I could spread them out a bit and that would help.