PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: ProgressBar control  (Read 870 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
ProgressBar control
« on: August 24, 2019, 11:38:15 PM »

Just a quick note that I have now completed adding the ProgressBar control to WinFBE's visual designer.
I hope to have a new beta (beta 3) uploaded today for everyone to test.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #1 on: May 16, 2020, 08:13:41 AM »

What determines if a progressbar displays a solid or broken fill indicator?
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3269
Re: ProgressBar control
« Reply #2 on: May 16, 2020, 10:14:14 AM »

The use of visual themes. If you use visual themes, it appears solid; otherwise, broken.

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: ProgressBar control
« Reply #3 on: May 16, 2020, 01:16:45 PM »

In WinFBE, to ensure that your application is themed, you should create your forms as part of a Project. One of the project options is to automatically create a resource file and manifest file. The manifest file will activate the theming for you.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #4 on: May 17, 2020, 05:15:48 AM »

So once a form module has been in a project, it retains its theme?
That would explain why registry2.exe is maintaining the solid fill, even though it was subsequently renamed, and compiled multiple times as a single file.

I prefer the solid fill theme, yet I wish to know which entry in the code enables/disables visual themes.
« Last Edit: May 17, 2020, 05:18:32 AM by Bumblebee »
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: ProgressBar control
« Reply #5 on: May 17, 2020, 07:23:27 AM »

I prefer the solid fill theme, yet I wish to know which entry in the code enables/disables visual themes.

The theme is activated via the inclusion of the mainfest.xml file, which is included in your project via the resource.rc file:
Code: [Select]

//=============================================================================
// Manifest
//=============================================================================
1 24 ".\manifest.xml"


You can read all about it here:  https://docs.microsoft.com/en-us/windows/win32/controls/cookbook-overview
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #6 on: May 17, 2020, 11:47:28 AM »

I created two files, outside and within a project. The sole difference is in the comment field:
Code: [Select]
' You should always include a resource file that references a valid manifest.xml
' file otherwise your application will not properly display Windows themed controls.
' Sample resource.rc and manifest.xml files can be found in the WinFBE \Settings folder.
' The following WinFBE directive includes the resource in your application. Simply
' uncomment the line.
' If you are using WinFBE's project management features then delete the following line
' because a resource file will be generated automatically.
'     '#RESOURCE "resource.rc"

If I uncomment the line, there's a syntax error.
Are you using a comment block as a switch to apply visual themes?

Consistent behavior would be: If within a project, apply manifest when compiling. If outside (single file), do not apply the manifest.
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: ProgressBar control
« Reply #7 on: May 17, 2020, 12:22:13 PM »

Yes, you would get a compile error if you simply uncomment the line because you need to have a "resource.rc" file exist in your folder with the file you are compiling. The comment indicates that you can get sample resource file and manifest file from the \Settings folder. Outside of a project it is entirely the programmer's responsibility to include the resource file, etc. Only from within a project are resources and manifests automated.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #8 on: May 17, 2020, 08:50:44 PM »

Those files are in my FB folder. (resource.rc and manifest.xml) They were copied there when I created a test project. All my bas files are in this folder.
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: ProgressBar control
« Reply #9 on: May 17, 2020, 10:31:06 PM »

If you are still getting a compile error then ensure that only one of the ' comment characters are removed:

'#RESOURCE "resource.rc"

Notice the single ' comment character. WinFBE parses for the '#RESOURCE tag.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #10 on: May 18, 2020, 05:49:46 AM »

Yes, this works. It works for bas files that have never been in a project.
Logged

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #11 on: May 18, 2020, 04:11:28 PM »

Is #RESOURCE a current or future preprocessor directive?
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Re: ProgressBar control
« Reply #12 on: May 18, 2020, 05:48:09 PM »

'RESOURCE is just something that I built into WinFBE to make it a little easier for people not using Projects to be able to add a resource to their form.

There are two others

'#CONSOLE ON

'#CONSOLE OFF
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Bumblebee

  • Little Newbie
  • *
  • Posts: 43
Re: ProgressBar control
« Reply #13 on: May 19, 2020, 10:26:01 AM »

I did a search for #CONSOLE and your post is the only result. Let the people know!

Sorry for being confused. If I'd seen 'Resource=False I would've assumed it wasn't meant as literal FB code.
Logged