|
SYS-CON.TV Webcasts
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Top Links You Must Click On
Deployment Making Our Client/Server Application Look Like an HTML App
Avoiding redevelopment: Part 2
By: Franck Fasolin
Feb. 2, 2007 01:00 PM
What made Web application development initially so successful was that Web applications looked pretty. They usually included graphics made by graphic design experts.
This is why we're moving back to client/server application development with .NET Winforms technology. We now say "rich client user interface" to be politically correct. But this is still client/server application development and we have the best client/server application development in PowerBuilder. We saw in Part One of this article that we don't have to install any software on the client computer to run a PowerBuilder application (except for the database driver that can be auto-deployed by your system manager or when installing the computer). You can easily make your PowerBuilder application look great with little effort. Most of my users don't know they're running a client/server application from our intranet. The application looks like a Web application. It respects the intranet's graphical standards but implements complex GUI behaviors that would be difficult to implement with classic Web application development technologies. PowerBuilder 11.5 introduced new Windows XP controls that can make applications look better. If you moved to PB 11.5 I recommend that you use those sexy new controls. Here comes a migration process I've set up to help developers rapidly migrate their PowerBuilder apps to a nice-looking GUI that fits their intranet.
Migrating the Workspace Most PowerBuilder applications use an MDI user interface. Users navigate using the frame's top menus and it opens sheet windows in the frame workspace. When the application is launched, the MDI frame is empty, making it look real ugly (see Figure 1). 1. Create the navigation frame set. Most PowerBuilder applications were created years ago and were made to fit an 800x600 SVGA screen. This is why they look so ugly today; most of them don't fit our screens. Now our screens are 1024x768 or higher. We can use a 224-pixel frame to implement a navigating feature, and a 168-pixel frame to implement a nice-looking header feature. In this example, I'll implement the navigation feature as a datawindow with a nice background image. The header feature will also use a datawindow with a nice background image. I recommend that you use your intranet's graphics to do so. Just add two datawindow controls to your MDI frame and set their dataobject. 2. Create an external freeform datawindow (no matter the source columns). Include a nice horizontal background picture in the datawindow header. Put a text object on it and call it "t_title." We'll use it to display our application window's title. Add a datawindow control to your MDI frame window, set the dataobject with your newly created one, and call the control dw_upper_frame (see Figure 2). 3. Create an external tabular datawindow with four columns: menu_name string(60), menu_text string(100), menu_level number, and selected number. Erase all created objects and add a nice vertical background picture on the datawindow. Specify that the picture is in the background band. Add a computed field that displays the menu_name columns and call it level_1. In its visible property, specify that it should appear only when the menu_level = 1. Do the same with a level 2 computed field. In its y conditional property specify that it must be four. Specify also that the level_2 text is underlined. Format both objects to make it look good. Add a datawindow control to your MDI frame window, set the dataobject with your newly created one, and callthe control dw_left_frame (see Figure 3). 4. Implement a hyperlink link behavior for the left-side datawindow. This is easily done. Just add two functions to your MDI window. The first one returns a string to be imported in the left frame datawindow. It describes all the menu items found in a specified menu. The second one will return a pointer to a menu item from its name. It's used to trigger the clicked event of the menu item corresponding to the clicked row of the left frame datawindow. In the open event of the window, I initialize the left frame datawindow by importing the navigation menus of my application. I added a ue_mouse_move event that maps the pbm_mousemove event id. This will simulate the hyperlink graphical behaviour. See Listing 1 for the code. 5. I implemented "HTML-like" behavior in mycustom frameset. All you have to do is resize all the datawindows and mdiclient area of the MDI windows in its resize event. Then change the window state of all the sheet windows in their open even: (this.windowstate = maximize!) so that your application looks more like a Web browser SDI application. See Listing 2. 6. Make it look like a Web application. I modified all my windows and datawindows so their background fit the graphical theme I used to create the button face background windows. I used white background windows. Modify all your column labels to look more colourful. I used a button face color with a 3D raised border, a nice blue for their background color, white for the font color, and 3D lowered for their border. Modify all tabular and grid datawindows to make odd rows display in one color and even rows display in another. The background color is a conditional property: if(mod(getrow(),2)=1,rgb(255,255,255),rgb(192,220,240)) If you're using PB11.5 you can modify all the date columns to display a Windows XP calendar to enter the date value. Last but not least, add nice pictures and some helpful text if you have enough space and compile your application by specifying that you want to use the new visual style controls included in PowerBuilder (see Figure 4).
Conclusion In a few minutes, you can migrate your existing PowerBuilder client/server so it looks more like an intranet application. Here I just gave a first step for migrating such an application. You can set up many ".NET-like" or "Web-like" features so your application fits today's graphical standards more. I personally add an IE ActiveX control to my MDI frame so it displays an HTML page when no sheet windows are opened. This gives my applications portal-like behavior that my users enjoy very much. With the new .NET Winforms and Webforms PowerBuilder generation, we can forget the idea of redeveloping our client/server applications. PowerBuilder isn't dead, it's here to stay! Reader Feedback: Page 1 of 1
Your Feedback
Enterprise Open Source Magazine Latest Stories . . .
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||