Posts

New Controls for your PowerBuilder Datawindow

Image
It seems that over the years, I usually declare the next release of Ultimate Suite for PowerBuilder as the most exciting. For me, this is usually true; it's exciting to be able to provide PowerBuilder developers not only with new UI Controls to help update the look of their applications, but to provide controls that help extend functionality (allowing you to add new features to your applications). The Ultimate Suite 2021 release has a new set of controls for your windows and user objects. In addition to this, some of these new controls have been brought into the datawindow. Most of our PowerBuilder applications are heavily data driven and rely on the datawindow to display and persist data. Having new UI controls available right in the datawindow will make it easier for you to use them in your applications; Easier to display, print, or export to PDF. Here is a rundown of the new datawindow UI controls: Circle Progress This control is used to visually display a percentage or progress

Media Player Built Entirely with PowerBuilder and Ultimate Suite for PowerBuilder

Image
The next release of Ultimate Suite is going to include a new Circle Progress control. The best way to make sure that a new control covers all the needs of the developer is to use it in a real world application. Doing this allows you to identify deficiencies in the design or behavior. The best way I could think of to do this was to use the Circle Progress control within a media player. It can be used to start or pause playback and display the video's elapsed time. Using the Ultimate Suite caption-less window, some toolbars, the circle progress control and the Windows Media Player Active-X control, we get the following: To create this, first inherit a new window from w_pbus_spa_captionless. Add a logo, static text for the application label, two toolbars for the play back options, and the circle progress control. Next, add an OLE control and select Windows Media Player. In the open event of the window, add the following code: //Use a custom color for the window background color THIS .

New Controls Coming in the Next Release of Ultimate Suite for PowerBuilder!

Image
 A lot of work is going into the next release of Ultimate Suite for PowerBuilder. Here are some of the highlights: Progress Indicator on the PB Command Button You will be able to display a visual indicating progress right within the PB command button. Look for the new of_SetProgress function. Circle Progress Control The Circle Progress control allows you to visual display a percentage of completion. Customizable features include theme, circle thickness, font, and font size. Instead of displaying a percentage, you can display an image in the center of the circle. Stepbar Control The Stepbar control is perfect for displaying overall progress through a series of more complex steps. Any number of steps are allowed and will size to fix the width or height of the control. Both horizontal and vertical orientations are supported.  Card Control Cards are a nice way to combine imagery with text.  Image Compare Control If your users need to compare two images, this control can help you minimize t

PowerBuilder Code Beautifier / Formatter

Image
 A new code beautifier for PowerBuilder (PowerScript) code has been added to NotepadPB: https://powertothebuilder.com/NotepadPB.html This is the first and initial version which uses a very simple approach to formatting the code. NotepadPB will use multiple passes to adjust spacing, casing, and indenting of the script. The process works as follows: Start by tokenizing the script by splitting everything into words or characters (characters for things like quotes). We then loop through each token and determine if it's a keyword, datatype, quote, comment, carriage return, or user defined text (like variable names). We change the case on keywords and datatypes, and track indent level if the keyword is an indent-able keyword (e.g. IF, FOR, CHOOSE, etc). Comments and quoted text are ignored, we don't want to modify them. At the end, we reassemble our script. In our second pass, we parse our script by line. We will apply some formatting on a line by line bases. The second pass is meant

Develop a web browser in PowerBuilder.

Image
The inclusion of the new Chromium Web Browser control in PowerBuilder 2019R2 gave us the possibility to develop our own web browser in PowerBuilder. We could have done this already with the MS Web Browser control but we would have had to accept the limitation of IE. With the new PowerBuilder control, we know that we'll have maximum compatibility with the most up to date web sites. Microsoft even accepts this after converting Edge to use Chromium.  So the big question, why? The short answer to that is... to learn something new. I've been developing software for 20 years. In those years I've developed countless of useless applications just for the sake of learning (I once developed a fully functional version of Mine Sweeper in Silverlight). Below is what we'll create. We'll use the PB Chromium Web Browser control with the Ultimate Suite for PowerBuilder Tabbed Caption window. Some things we'll accept right away; 1) This browser is extremely basic so we won't

Custom captions, everyone's doing it...

Image
We see custom captions all over the place, used by many software vendors. Microsoft even prefers them for their largest applications (Office, VS, Edge, etc). Why use a custom caption in your window? The simplest answer is, you get to make use of otherwise wasted real estate. With a custom caption you can add buttons, search boxes, status messages, tabs, etc., you name it. Ultimate Suite for PowerBuilder offers 3 different types of custom captions window. 1) Basic With the basic option you get the ability to add toolbar buttons to the caption. You can also add any other control you like in the window painter. The controls you add would simply overlay the caption. 2) Tabbed The tabbed caption window is extremely unique to Ultimate Suite for PowerBuilder. It allows you to have a browser like UI. This is prefect for single purpose applications (like a web browser). A perfect example of where this UI fits perfect can be found here:  https://powertothebuilder.com/NotepadPB.

Update the look of all your PowerBuilder message boxes in a few easy steps

Image
One simple way to update your PowerBuilder application is to convert all your message boxes to use the Windows 10 style PowerMessage object from Ultimate Suite for PowerBuilder: Having to change all message boxes one by one would be too time consuming. You also run the risk of missing some. Instead, what we can do is create a new, overloaded, global function that overrides the built in PowerBuilder MessageBox function. Before we do this, let's setup PowerMessage. Make sure you have the Ultimate Suite for PowerBuilder PBL's or PBD's added to your library list. Next, create a new global variable: n_cst_powermessage PowerMessage In the Open event of your main frame window, register your window with PowerMessage: PowerMessage.of_Register(THIS) PowerMessage is now setup and ready to be used. Note that at this point, if you like, you call call into PowerMessage directly to display the updated message: PowerMessage.MessageBox("Title", "Message T