Metro Toolbar from template

We were looking for a “non-Clarion” look for a simple application to schedule backups and tasks for a client’s MSSQL Express database. We were aiming to get rid of the standard Windows caption bar and saw Brahn’s Metro Class example and thought we could use the same Windows API technique that he used. We didn’t particularly want the Metro style sidebar, just a simple toolbar. This was the outcome. 100% Clarion, no third party tools, simple restyle of the appearance.

5 Likes

@PurpleEdge2214 Thanks for your screenshot, looks great!

I was trying to work out what you mean by this. Is it in reference to how the example app allows you to move the window by clicking on the header?
The only reason I bring it up is because the ClarionMetroWizard is 100% Clarion as well as far as I know, (Edit: Yes, there is an API call. See next post!) that’s part of its charm :grin: Which now makes me curious to know if you found an alternative technique and if you could share it also.

That particular trick in the MetroWizard for moving this window I picked up in the Newsgroups somewhere and looks like this:

The main issue with this of course is that it blocks the UI thread but otherwise it is quite effective :smile:

So of course I just found the spot you mean 10 seconds after posting the above…

This bit yeah?

1 Like

Hi Brahn, Yeah - I include Windows API’s as 100% Clarion because they are all basically “in-the-box” now

I found that by disabling the window resize, with 0{Prop:Resize} = false, there was a bit more flexibility in the border types…

    0{Prop:Resize} = False                                  ! Allow frame type to be set
    windowStyle = GetWindowLong(0{PROP:Handle}, GWL_STYLE)
    windowStyle = BXOR(windowStyle, WS_CAPTION)             
    IF Self.MaximizeThisWindow = True
        Self.BorderType = 1
    END    
    IF Self.BorderType = 1    ! Default no border, and no border if maximized
    ELSIF(pbBorderType = 2)
        windowStyle = BXOR(windowStyle, WS_BORDER)          ! Thin frame - black
    ELSIF(pbBorderType = 3)
        windowStyle = BXOR(windowStyle, WS_THICKFRAME)      ! Resizable frame
    END   
    SetWindowLong(0{PROP:Handle}, GWL_STYLE, windowStyle)   ! redraw the window with the Windows caption bar hidden
1 Like

I’ve tinkered with the template a bit, here are some pics from a School App. I’m thinking about making the template available if there is any interest in this style of app?

The app frame toolbar is configured at design time by the developer, adding whatever buttons, backgrounds etc they want. The template removes the Windows caption bar and adds a region for moving the frame around.

The app frame is configured by the template and can be resizable.

The app can have a frame background which is a window procedure that is automatically centered and disabled/enabled whenever an MDI window is opened, so the MDI window never gets hidden behind the frame background. This background window can be used as a communication device to the user, or another navigation container, or whatever else want?

I haven’t done anything to handle the menu, it could be probably be regenerated as a Toolbox procedure using Brahn’s classes, or converted to a toolbar(s) on the frame? I’m actually getting used to seeing the menu above the Metro caption bar, but it is a bit of an oddity?

In my simple app I was able to replace the menu with toolbar buttons.

Windows can have global styles or locally set icons, caption backgrounds, and borders.

SDI windows are supported.

messagehook can be used to style a custom MESSAGE() procedure - embedded code can customize the caption bar with different colors, icons etc at runtime, depending on the message.

1 Like

Hi i am interest on the template can you share it

best regars
Victor M.

1 Like

Yeah I’ve decided that I don’t have the patience to make it a commercial venture, so I’ll prepare an installation and upload it to my website. Shouldn’t take too long, I’m just familiarizing myself with Setup Builder.

1 Like

The template is now available as a download from…

http://www.comformark.com.au/clarion-metro-caption-template/

Sorry, updated my website, new link…

https://www.comformark.com.au/news/clarion-metro-caption-template/

7 Likes