In a previous post I discussed how we wanted to “modernize” the appearance of a simple Clarion application. We decided to use styling similar to that found in Norton Internet Security, namely a single MDI frame with a large toolbar and sub windows maximized within the main frame.
Thanks to the Clarion Metro Wizard class posted by Brahn Partridge we found the means to remove the standard Windows caption bar and replace it with a “Metro” style caption bar. We adapted this to a frame procedure and set about building our app with maximized MDI child procedure windows.
Maximized Child Procedure Windows
It is possible to develop an application in Clarion with all child procedure windows maximized, but there isn’t a “switch” to achieve this. So, we developed the procedures we needed and set the necessary properties to maximize each window, and hide the title bar and borders. Then we added some code to display the missing window title in the caption bar of the frame.
After we’d done a few windows we realized we were working harder, not smarter which is not the way things should be done with Clarion. So, we developed a template, then we added a class.
What the Metro Caption template does
The template evolved as we worked with it and discovered the little idiosyncrasies of Metro style apps. These are some of the things we have addressed…
For the Frame procedure
- Hide the Windows caption bar.
- Add a region to a toolbar on the application frame to allow moving the frame.
For Maximized child procedures
- Remove the caption and borders from maximized MDI child windows.
- Resize child MDI windows to fill the frame.
- Disable the default Clarion resizer.
- Update the frame caption bar text with the current child window title text.
- Centre controls within the resized window
- Support for resizing windows.
- Only allow a maximized procedure to be started once.
- Manage which procedure has focus.
For non-maximized child windows
- Hide the Windows caption bar.
- Add a toobar, region and icons to create a Metro-style caption.
- Provide a Frame Background Procedure
- Allow a procedure to be the frame background, with full functionality.
- Enable and disable the background procedure to prevent MDI windows becoming hidden behind it.
- Add routines and embed points for finer programmer control of functionality.