祝愿大家身体健康!

 站点注册  找回密码
 站点注册

QQ登录

只需一步,快速开始

查看: 8589|回复: 0

[PB10-15.X] PowerBuilder 15 Classic Sneak Preview

[复制链接]

[PB10-15.X] PowerBuilder 15 Classic Sneak Preview

[复制链接]
lbcast

主题

0

回帖

5691

积分

论坛元老

积分
5691
贡献
在线时间
小时
2012-5-22 07:38:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?站点注册

×
In my previous article for PowerBuilder Developer's Journal (Vol. 18 issue 8), I gave a sneak preview of some of the things we were working on for PB15 Classic. This is a closer look at one of them - Tabs and Docking in MDI Windows.
Recall that in the article we mentioned adding two new WindowType values - mdidock! and mdidockhelp! - to the window object. Like values mdi! and mdihelp!, respectively, they allow child windows (sheets) to be opened with the OpenSheet functions. But these sheets will behave differently: they can dock, float and be tabbed like the windows you see in our PB.NET IDE.
Your sheets will open docked by default (we will see how to control this later in the article). Once opened, they can be moved, docked in much the same way you can with the PB.NET IDE window. The sheets can be in one of four states:
  • Tabbed Document: In PB.NET IDE, script editors and window painters are tabbed documents - anything with an entry in the "Window" menu item of the PB.NET IDE (see Figure 1)
  • Docked: In PB.NET IDE, all other windows, e.g., Toolbox, Solution Explorer, etc.
  • Floating
  • Tabbed Windows: Docked windows occupying the same space will be tabbed. The tabs appear at the bottom. Notice that in the PB.NET IDE, the Solution Explorer and Properties Window are usually docked at the same location and appear as windows in a tabbed group. The main differences with tabbed documents are that tabbed windows have tabs at the bottom and have no corresponding entries in the "Windows" menu item.
As in the PB.NET IDE, the opened sheets can be moved, docked, tabbed, and turned into tabbed documents interactively with the mouse. A property will be introduced on child windows to control which states to allow on that window. For example, you may want to prevent the end user from turning a docked window into a document (see Figure 1).
Figure 1
Programmatically Opening Sheets in a Specific State
To open a sheet at a specific docking location, in a specific tab group or as a document, we are introducing new versions of the OpenSheet function:
  • OpenSheetAsDocument
  • OpenSheetDocked
  • OpenSheetInTabGroup
  • OpenSheetWithParmAsDocument
  • OpenSheetWithParmDocked
  • OpenSheetWithParmInTabGroup
OpenSheetInTabGroup and OpenSheetWithParmInTabGroup, as their names suggest, open a sheet in a tab group. Unlike the other OpenSheet functions, these take as one of their arguments, not the parent window, but a sibling sheet. These sibling sheets must either be docked or in a tab group.
Persisting MDI State
One of the things you'll notice about the PB.NET IDE is that when you launch it, it restores all the open windows at exactly the same position and state as when you closed it. In PB15 there is going to be an easy way to get the same thing.
The most important thing is to be able to associate a meaningful string ID to each opened sheet. One suggestion - if you use the OpenSheetWithParm family of functions - is to come up with a string representation of the "parm" and be able to convert one from the other. These IDs will be needed either as arguments to the new OpenSheet functions or passed separately using the new SetSheetID function (see Figure 2).

Figure 2
The MDI state is stored in the registry using the new SaveDockingState function that you'll want to call when your application is closed (see Figure 3).

Figure 3
When your application is launched, three new functions will help you restore your sheets.
LoadDockingState will fill two equal-sized arrays. One will be an array of type names of persisted sheets. The other will be their corresponding IDs. For these persisted sheets, a new function is introduced to open them: OpenSheetFromDockingState (and OpenSheetWithParmFromDockingState). When all persisted sheets are open, the CommitDocking function will do the work of arranging everything in place and making them visible (see Figure 4).

Figure 4
Look and Feel
To give you more control over the look and feel of your final application, there will be new properties (see Figures 5-7) to allow you to specify:
Figure 5
  • The colors of active and inactive title bars (horizontal/vertical gradients optional)
  • The colors of the area behind tabs (horizontal/vertical gradients optional)
  • The colors of tabs (active/inactive/mouseover); deferring to theme colors is also an option
  • The shape of tabs
  • The location of the close button for tabs
  • Whether to show all tabs (squeezed) or scroll them
Figure 6
Figure 7
Conclusion
The most important thing to remember here is that you can start with an existing MDI application and just change the window type of your main application window. Then start experimenting with the other features - knowing (and comforted by the fact) that the controls within your MDI sheets will continue to behave correctly unchanged. Start planning for the beta!

共享共进共赢Sharing And Win-win Results
SYBASEBBS - 免责申明1、欢迎访问“SYBASEBBS.COM”,本文内容及相关资源来源于网络,版权归版权方所有!本站原创内容版权归本站所有,请勿转载!
2、本文内容仅代表作者观点,不代表本站立场,作者自负,本站资源仅供学习研究,请勿非法使用,否则后果自负!请下载后24小时内删除!
3、本文内容,包括但不限于源码、文字、图片等,仅供参考。本站不对其安全性,正确性等作出保证。但本站会尽量审核会员发表的内容。
4、如本帖侵犯到任何版权问题,请立即告知本站 ,本站将及时删除并致以最深的歉意!客服邮箱:admin@sybasebbs.com
您需要登录后才可以回帖 登录 | 站点注册

本版积分规则

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com

QQ|Archiver|PowerBuilder(PB)BBS社区 ( 鲁ICP备2021027222号-1 )

GMT+8, 2024-3-29 02:44 , Processed in 0.037203 second(s), 9 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表