Very Simple GUI
#80
This went pretty well! Now you make controls from a form in your favorite txt editor, the QB64 code reads the form and writes the NewControl line for your app and you check it over and add it to the Control Stack.txt file if looks OK or send it back to editor (or quit).

Code: (Select All)
_Title "Make New Controls with Properties" ' b+ 2022-06-30
' oh put in defaults if things are left blank, eh do it with NewControl Function need to know conType.

Input "Clear the Controls Stack.txt file (for fresh start)? Enter y/n "; answer$

If LCase$(answer$) = "y" Then
    Open "Controls Stack.txt" For Output As #1
    Close #1
End If
Do
    Input "Enter 'e' to Edit last control saved, enter 'a' for A new control blank, enter 'q' to Quit "; answer$
    If LCase$(answer$) = "e" Then
        GoTo edit
    ElseIf answer$ = "a" Then
        GoTo again
    Else
        End
    End If

    again: ' fresh form
    Open "Control Properties Form.txt" For Output As #1
    Print #1, "      Edit your New Control Properties as needed:"
    Print #1, ""
    Print #1, "  Tip: Run the 3 Digit Color Picker with the txt Editor."
    Print #1, ""
    Print #1, "                                Control Name / Handle = "
    Print #1, "Control type 1:Btn, 2:TB, 3:Lst, 4:Lbl, 5:Pic conType = "
    Print #1, "                                          Left side X = "
    Print #1, "                                                Top Y = "
    Print #1, "                                              Width W = "
    Print #1, "                                             Height H = "
    Print #1, "                                       Font Height FH = "
    Print #1, "                                3 Digit Fore Color FC = "
    Print #1, "                                3 Digit Back Color BC = "
    Print #1, "                       T/F, Yes:-1 or No:0   Tab Stop = -1"
    Print #1, "                  T/F: active/hidden use -1 or 0 Hide = 0"
    Print #1, "                                                 Text = "
    Print #1, "              Font .ttf, Data .txt or Image .png File = "
    Print #1, ""
    Print #1, ""
    Print #1, "Fill out the parts right of = sign, Save and Exit you txt Editor."
    Print #1, ""
    Print #1, "Note:"
    Print #1, "All are Long number types except Text and File which are strings, colors are 3 digits Integers for RGB conversion."
    Close #1

    edit: ' current form
    Shell Chr$(34) + "Control Properties Form.txt" + Chr$(34)

    ' Write a NewControl line and check it
    Open "Control Properties Form.txt" For Input As #1
    For i = 1 To 5
        Line Input #1, fl$
    Next
    s$ = RightOf$(fl$, "=") + " = NewControl(" ' name/handle
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' contype
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' X
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' Y
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' W
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' H
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' FH
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' FC
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' BC
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' Tab
    Line Input #1, fl$
    s$ = s$ + RightOf$(fl$, "=") + ", " ' Hide
    Line Input #1, fl$
    s$ = s$ + Chr$(34) + RightOf$(fl$, "=") + Chr$(34) + ", " ' Text
    Line Input #1, fl$
    s$ = s$ + Chr$(34) + RightOf$(fl$, "=") + Chr$(34) + ")" ' File
    Close #1
    Print s$ ' let's see what we have
    Input "Add to Controls Stack y/n"; answer$
    If LCase$(answer$) = "y" Then
        Open "Controls Stack.txt" For Append As #1
        Print #1, s$
        Close #1
    End If
Loop

' update these 2 in case of$ is not found! 2021-02-13    mod with trim$  for this app
Function RightOf$ (source$, of$)
    If InStr(source$, of$) > 0 Then RightOf$ = _Trim$(Mid$(source$, InStr(source$, of$) + Len(of$))) Else RightOf$ = ""
End Function
b = b + ...
Reply


Messages In This Thread
Very Simple GUI - by bplus - 06-14-2022, 04:15 AM
RE: Very Simple GUI - by vince - 06-14-2022, 04:17 AM
RE: Very Simple GUI - by James D Jarvis - 06-14-2022, 04:26 AM
RE: Very Simple GUI - by bplus - 06-14-2022, 04:35 AM
RE: Very Simple GUI - by johnno56 - 06-14-2022, 05:42 AM
RE: Very Simple GUI - by Coolman - 06-14-2022, 08:21 AM
RE: Very Simple GUI - by RNBW - 06-14-2022, 09:50 AM
RE: Very Simple GUI - by Pete - 06-14-2022, 10:32 AM
RE: Very Simple GUI - by bplus - 06-14-2022, 02:32 PM
RE: Very Simple GUI - by Pete - 06-14-2022, 04:33 PM
RE: Very Simple GUI - by bplus - 06-15-2022, 01:45 PM
RE: Very Simple GUI - by bplus - 06-15-2022, 04:39 PM
RE: Very Simple GUI - by Coolman - 06-15-2022, 05:01 PM
RE: Very Simple GUI - by bplus - 06-15-2022, 05:04 PM
RE: Very Simple GUI - by Coolman - 06-15-2022, 06:38 PM
RE: Very Simple GUI - by Kernelpanic - 06-15-2022, 08:51 PM
RE: Very Simple GUI - by bplus - 06-15-2022, 09:00 PM
RE: Very Simple GUI - by Kernelpanic - 06-15-2022, 10:44 PM
RE: Very Simple GUI - by Kernelpanic - 06-15-2022, 10:54 PM
RE: Very Simple GUI - by bplus - 06-16-2022, 01:10 AM
RE: Very Simple GUI - by bplus - 06-16-2022, 05:28 AM
RE: Very Simple GUI - by RNBW - 06-16-2022, 11:31 AM
RE: Very Simple GUI - by RNBW - 06-16-2022, 11:36 AM
RE: Very Simple GUI - by bplus - 06-16-2022, 04:02 PM
RE: Very Simple GUI - by RNBW - 06-16-2022, 06:27 PM
RE: Very Simple GUI - by RNBW - 06-16-2022, 06:54 PM
RE: Very Simple GUI - by RhoSigma - 06-16-2022, 09:01 PM
RE: Very Simple GUI - by Kernelpanic - 06-16-2022, 09:30 PM
RE: Very Simple GUI - by Coolman - 06-16-2022, 10:09 PM
RE: Very Simple GUI - by RNBW - 06-17-2022, 10:55 AM
RE: Very Simple GUI - by bplus - 06-17-2022, 01:54 AM
RE: Very Simple GUI - by Coolman - 06-17-2022, 09:03 AM
RE: Very Simple GUI - by bplus - 06-17-2022, 12:35 PM
RE: Very Simple GUI - by Coolman - 06-17-2022, 01:59 PM
RE: Very Simple GUI - by RNBW - 06-17-2022, 11:17 AM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 12:35 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 12:55 PM
RE: Very Simple GUI - by RNBW - 06-17-2022, 02:36 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 02:47 PM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 02:53 PM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 12:42 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 12:42 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 01:38 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 02:22 PM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 02:46 PM
RE: Very Simple GUI - by Coolman - 06-17-2022, 02:56 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 03:04 PM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 03:15 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 03:17 PM
RE: Very Simple GUI - by Kernelpanic - 06-17-2022, 06:31 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 07:53 PM
RE: Very Simple GUI - by bplus - 06-17-2022, 08:08 PM
RE: Very Simple GUI - by Dav - 06-19-2022, 01:36 AM
RE: Very Simple GUI - by bplus - 06-19-2022, 02:02 AM
RE: Very Simple GUI - by Kernelpanic - 06-19-2022, 10:51 PM
RE: Very Simple GUI - by bplus - 06-19-2022, 07:55 PM
RE: Very Simple GUI - by bplus - 06-20-2022, 05:17 AM
RE: Very Simple GUI - by Coolman - 06-20-2022, 10:58 AM
RE: Very Simple GUI - by bplus - 06-20-2022, 04:36 PM
RE: Very Simple GUI - by bplus - 06-20-2022, 06:24 PM
RE: Very Simple GUI - by bplus - 06-20-2022, 06:50 PM
RE: Very Simple GUI - by bplus - 06-20-2022, 08:33 PM
RE: Very Simple GUI - by vince - 06-20-2022, 11:39 PM
RE: Very Simple GUI - by bplus - 06-21-2022, 04:36 PM
RE: Very Simple GUI - by bplus - 06-22-2022, 01:01 PM
RE: Very Simple GUI - by bplus - 06-22-2022, 10:27 PM
RE: Very Simple GUI - by bplus - 06-23-2022, 11:05 AM
RE: Very Simple GUI - by bplus - 06-26-2022, 01:44 AM
RE: Very Simple GUI - by bplus - 06-26-2022, 10:53 PM
RE: Very Simple GUI - by aurel - 06-27-2022, 06:17 AM
RE: Very Simple GUI - by bplus - 06-27-2022, 10:39 AM
RE: Very Simple GUI - by RNBW - 06-27-2022, 11:10 AM
RE: Very Simple GUI - by bplus - 06-28-2022, 02:27 AM
RE: Very Simple GUI - by bplus - 06-29-2022, 03:56 PM
RE: Very Simple GUI - by Coolman - 06-29-2022, 05:03 PM
RE: Very Simple GUI - by bplus - 06-29-2022, 05:22 PM
RE: Very Simple GUI - by bplus - 06-30-2022, 01:46 PM
RE: Very Simple GUI - by bplus - 06-30-2022, 01:52 PM
RE: Very Simple GUI - by bplus - 06-30-2022, 06:35 PM
RE: Very Simple GUI - by bplus - 06-30-2022, 06:51 PM
RE: Very Simple GUI - by Kernelpanic - 06-30-2022, 09:41 PM
RE: Very Simple GUI - by bplus - 07-01-2022, 10:20 PM
RE: Very Simple GUI - by vince - 07-01-2022, 10:24 PM
RE: Very Simple GUI - by bplus - 07-02-2022, 04:26 PM
RE: Very Simple GUI - by Kernelpanic - 07-02-2022, 05:24 PM
RE: Very Simple GUI - by bplus - 07-02-2022, 06:05 PM
RE: Very Simple GUI - by Kernelpanic - 07-02-2022, 06:19 PM
RE: Very Simple GUI - by bplus - 07-02-2022, 06:23 PM
RE: Very Simple GUI - by Kernelpanic - 07-02-2022, 06:33 PM
RE: Very Simple GUI - by bplus - 07-06-2022, 09:08 PM
RE: Very Simple GUI - by Kernelpanic - 07-07-2022, 03:20 PM
RE: Very Simple GUI - by bplus - 07-12-2022, 02:39 AM
RE: Very Simple GUI - by jjharley - 07-19-2022, 03:38 PM
RE: Very Simple GUI - by bplus - 07-19-2022, 04:08 PM
RE: Very Simple GUI - by vince - 04-25-2023, 03:10 AM
RE: Very Simple GUI - by bplus - 04-25-2023, 03:39 AM
RE: Very Simple GUI - by bplus - 04-25-2023, 04:00 PM
RE: Very Simple GUI - by vince - 04-25-2023, 09:02 PM
RE: Very Simple GUI - by bplus - 04-25-2023, 10:30 PM



Users browsing this thread: 25 Guest(s)