• Welcome to PlanetSquires Forums.
 

WinFBE 1.4.4 on GitHub (August 18, 2017)

Started by Paul Squires, August 18, 2017, 04:30:21 PM

Previous topic - Next topic

Paul Squires

#15
Yes, maybe I should switch over to the XPButton. Here are the things that I would need it to do:

- Be flat with no edges (or gradient)
- Allow me to draw a blue box around the edges to indicate a selected state (eg. the Match Case button).
- Allow hot tracking so when the mouse is over the button then the background color will change.
- Allow tooltips of course.

Also, a button control may look out of place in this situation because the pressing animation when the button is pressed down may not look right. Not sure.



Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Maybe I just need to steal the drawing code from the xp button to see if I am doing anything wrong that could help the sharpness of the image.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

> - Be flat with no edges (or gradient)

This can be achieved using the BS_FLAT style and disabling theming:


DIM pXpButton1 AS CXpButton = CXpButton(@pWindow, IDC_BUTTON1, "", 50, 20, 26, 26, _
       WS_VISIBLE OR WS_TABSTOP OR BS_PUSHBUTTON OR BS_CENTER OR BS_VCENTER OR BS_FLAT)
pXpButton1.DisableTheming


> - Allow hot tracking so when the mouse is over the button then the background color will change.

You can set an hot image and the control will do hot tracking.

> - Allow tooltips of course.

No problem.

> - Allow me to draw a blue box around the edges to indicate a selected state (eg. the Match Case button).
> Also, a button control may look out of place in this situation because the pressing animation when the button is pressed down may not look right. Not sure.

This will require some changes in the drawing code. Maybe setting a new flag.

José Roca

Anyway, although the replace icon looks sharp, the case.ico does not, but this is because the original icon image is very poor.

José Roca

The attached icons must look better.

José Roca

#20
Hi Paul,

See if changing


   ' Combobox to switch amongst the different build options
   ' Get the last button's rect and position the combobox immediately the right
'   HWND_FRMMAIN_COMBOBUILDS = _
'   pWindow->AddControl("COMBOBOX", hToolBar, IDC_FRMMAIN_COMBOBUILDS, "", _
'        pWindow->UnScaleX(rc.right) + 10, iif(pWindow->DPI = 96, 8, 2), 200, 20, _
'        WS_CHILD OR WS_VISIBLE OR WS_VSCROLL OR WS_BORDER OR WS_TABSTOP OR CBS_DROPDOWNLIST OR CBS_HASSTRINGS, _
'        WS_EX_LEFT Or WS_EX_LTRREADING Or WS_EX_RIGHTSCROLLBAR)
   HWND_FRMMAIN_COMBOBUILDS = _
   pWindow->AddControl("COMBOBOX", hToolBar, IDC_FRMMAIN_COMBOBUILDS, "", _
        pWindow->UnScaleX(rc.right + 10), pWindow->UnScaleX(10), 200, 20, _
        WS_CHILD OR WS_VISIBLE OR WS_VSCROLL OR WS_BORDER OR WS_TABSTOP OR CBS_DROPDOWNLIST OR CBS_HASSTRINGS, _
        WS_EX_LEFT Or WS_EX_LTRREADING Or WS_EX_RIGHTSCROLLBAR)


looks right at 96 DPI.

iif(pWindow->DPI = 96, 8, 2) is not correct because the value must be the same. What happens is that you must be trying it simulating 144 DPI with pWindow->DPI = 144, but that trick is not perfect because the window caption and the menu aren't scaled.

Paul Squires

Thanks Jose, I made the change but I have used 8 instead of 10 because it seems to centre better in the toolbar. I also corrected a scaling error with the toolbar itself. I was using parenthesis around the scaling ratio calculation.

From:
   Dim cx As Long = 24 * (pWindow->DPI \ 96)

To:
   Dim cx As Long = 24 * pWindow->DPI \ 96


   ' Combobox to switch amongst the different build options
   HWND_FRMMAIN_COMBOBUILDS = _
   pWindow->AddControl("COMBOBOX", hToolBar, IDC_FRMMAIN_COMBOBUILDS, "", _
        pWindow->UnScaleX(rc.right + 10), pWindow->UnScaleY(8), 200, 20, _
        WS_CHILD OR WS_VISIBLE OR WS_VSCROLL OR WS_BORDER OR WS_TABSTOP OR CBS_DROPDOWNLIST OR CBS_HASSTRINGS, _
        WS_EX_LEFT Or WS_EX_LTRREADING Or WS_EX_RIGHTSCROLLBAR)


I have uploaded the new EXE's to GitHub.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Working on the visual designer portion of WinFBE now.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Richard Kelly

I have small project in mind to test the designer out.

Rick

Paul Squires

#24
...does it involve SQLite :)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Richard Kelly

Quote from: TechSupport on August 22, 2017, 08:01:02 PM
...does it involve SQLite :)

SQLite will be part of two efforts. One is to put a GUI on my calendaring class.

Rick