Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color Issues: ForeColor/BackColor being erased upon saving & BackColor on Buttons has no effect #116

Open
GeorgeMcGinn opened this issue Dec 21, 2021 · 1 comment

Comments

@GeorgeMcGinn
Copy link
Contributor

GeorgeMcGinn commented Dec 21, 2021

Below is the .frm code to duplicate this issue.

I will load this .frm file into InForm, and it displays all the colors correctly. The buttons are a bluish background with black letters.

When I save this file or rename it, the colors stay the same except for the buttons. They take on the off-white color, and the code I put in for the ForeColor control disappear.

I have to manually add the Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0) back into the .frm file every time I change and re-save the form.

Also, I found that I cannot change the BackColor of the Buttons inside of InForm. When I go to each button and change it's value, whether I use the slider or type in the value (and hit return after each R,G,B value) the color on the form in InForm does not change.

To duplicate issue:

  1. Load .frm file into InForm
  2. Save Project or Save Project As (both does the same thing)
  3. Open the form again, and the original color of the buttons disappear and take on the ForeColor of the screen.

Here is the .frm file (I named it leagueStandings.frm)

': InForm - GUI library for QB64 - v1.3
': Fellippe Heitor, 2016-2021 - [email protected] - @fellippeheitor
': https://github.com/FellippeHeitor/InForm
'-----------------------------------------------------------
SUB __UI_LoadForm

    DIM __UI_NewID AS LONG, __UI_RegisterResult AS LONG

    __UI_NewID = __UI_NewControl(__UI_Type_Form, "leagueStandingsFM", 660, 660, 0, 0, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "Baseball/Softball Statistical Recordkeeping System"
    Control(__UI_NewID).Font = SetFont("/media/gjmcginn/Development/InForm/baseballStats/fonts/Ubuntu-B.ttf", 16)
    Control(__UI_NewID).ForeColor = _RGB32(248, 248, 248)
    Control(__UI_NewID).BackColor = _RGB32(76, 76, 76)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CenteredWindow = True

    __UI_NewID = __UI_NewControl(__UI_Type_ListBox, "displayResults", 610, 485, 23, 98, 0)
    __UI_RegisterResult = 0
    Control(__UI_NewID).Font = SetFont("/media/gjmcginn/Development/InForm/baseballStats/fonts/UbuntuMono-R.ttf", 17)
    Control(__UI_NewID).ForeColor = _RGB32(248, 248, 248)
    Control(__UI_NewID).BackColor = _RGB32(64, 64, 64)
    Control(__UI_NewID).HasBorder = True
    Control(__UI_NewID).CanHaveFocus = True
    Control(__UI_NewID).BorderSize = 2
    Control(__UI_NewID).AutoScroll = True

    __UI_NewID = __UI_NewControl(__UI_Type_Label, "header2LB", 299, 21, 23, 72, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "Teams Ranked by Win Percentage (WPCT)"
    Control(__UI_NewID).Font = SetFont("/media/gjmcginn/Development/InForm/baseballStats/fonts/Ubuntu-B.ttf", 16)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).VAlign = __UI_Middle

    __UI_NewID = __UI_NewControl(__UI_Type_Button, "CANCELBT", 88, 32, 89, 597, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&CANCEL"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(231, 233, 237)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_Button, "NEXTBT", 88, 32, 182, 597, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&NEXT"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(231, 233, 237)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_Button, "PRINTBT", 88, 32, 275, 597, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&PRINT"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(231, 233, 237)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_Button, "ABOUTBT", 88, 32, 368, 597, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&ABOUT"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(231, 233, 237)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_Button, "QUITBT", 88, 32, 461, 597, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&QUIT"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(231, 233, 237)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

    __UI_NewID = __UI_NewControl(__UI_Type_Label, "header1LB", 219, 29, 224, 19, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "LEAGUE STANDINGS"
    Control(__UI_NewID).Font = SetFont("/media/gjmcginn/Development/InForm/baseballStats/fonts/Ubuntu-B.ttf", 21)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).VAlign = __UI_Middle

    __UI_NewID = __UI_NewControl(__UI_Type_Label, "header1bLB", 207, 22, 224, 26, 0)
    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "__________________________"
    Control(__UI_NewID).ForeColor = _RGB32(248, 248, 248)
    Control(__UI_NewID).BackColor = _RGB32(64, 64, 64)
    Control(__UI_NewID).BackStyle = __UI_Transparent
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).VAlign = __UI_Middle

END SUB

SUB __UI_AssignIDs
    leagueStandingsFM = __UI_GetID("leagueStandingsFM")
    displayResults = __UI_GetID("displayResults")
    header2LB = __UI_GetID("header2LB")
    CANCELBT = __UI_GetID("CANCELBT")
    NEXTBT = __UI_GetID("NEXTBT")
    PRINTBT = __UI_GetID("PRINTBT")
    ABOUTBT = __UI_GetID("ABOUTBT")
    QUITBT = __UI_GetID("QUITBT")
    header1LB = __UI_GetID("header1LB")
    header1bLB = __UI_GetID("header1bLB")
END SUB
@GeorgeMcGinn
Copy link
Contributor Author

GeorgeMcGinn commented Dec 21, 2021

Further update:

I changed the CANCEL button manually to make the background of the button the same color as the form background, but it seems that it is being ignored.

Replace the CANCEL button code with the code below to duplicate:

    __UI_RegisterResult = 0
    SetCaption __UI_NewID, "&CANCEL"
    Control(__UI_NewID).ForeColor = _RGB32(0, 0, 0)
    Control(__UI_NewID).BackColor = _RGB32(64, 66, 69)
    Control(__UI_NewID).HasBorder = False
    Control(__UI_NewID).CanHaveFocus = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant