![]() |
|
QA: How can I implement the second toolbar like one in Pocket Word?
By Vassili Philippov, April 02, 2003.
QuestionI want to make two command bars in my application like it is implemented in Pocket Word. The second one should slide up automatically when SIP is shown. How can I do it? AnswerCreating the second command bar is simple. Here is a sample code:
You should also remember about SIP when positioning the second command bar. If SIP is shown then the second command bar should be placed above it. You can use the SipGetInfo function to test if SIP is shown and to get its height. The last thing you should worry about is moving the second command bar when SIP is shown or hidden. When SIP is shown or hidden your application receives a WM_SETTINGCHANGE message with wParam equal to SPI_SETSIPINFO. You should also check if SIP is shown or not and change the corresponding position of the command bar. SampleYou can download a sample project that demonstrates working with three command bars - TestSecondToolbar.zip - 16 Kb. It contains a reusable CCommandBarSet class that you may use for your projects to organize several command bars. This class encapsulates logic of the command bar positioning. Related resources:
DiscussDiscuss this article. Here you can write your comments and read comments of other developers. |
|||||||||||||||||||||