亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch12.htm

?? 好的教程Vc++21 天
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CBRS_ALIGN_ANY		</TD>		<TD ALIGN="LEFT">Allows the toolbar to be docked to any side of the view area of the frame window.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">CBRS_FLOAT_MULTI		</TD>		<TD ALIGN="LEFT">Allows multiple toolbars to be floated in a single miniframe window.		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">0		</TD>		<TD ALIGN="LEFT">The toolbar will not be able to dock with the frame.		</TD>	</TR></TABLE></P><P>The final function that you added was a frame window function, DockControlBar,which is passed the address of the toolbar variable. This function physically docksthe toolbar to the frame window. Because all of this code appears in the OnCreatefunction for the frame window, the toolbar is docked before the user sees eitherthe window or the toolbar.</P><P>Now, after adding all of this code to the OnCreate function of the CMainFrameclass, if you compile and run your application, you'll find a working color toolbarthat you can use to select the drawing color, as shown in Figure 12.3.</P><P><A HREF="javascript:popUp('12fig03tif.gif')"><B>FIGURE 12.3.</B></A><B> </B><I>Thecolor toolbar on the drawing program.</I></P><P><I></I><H3><A NAME="Heading5"></A>Controlling the Toolbar Visibility</H3><P>Now that you have your color toolbar on the frame of your drawing application,it would be nice to be able to show and hide it just as you can the default toolbarand status bar through the View menu. This is simple enough functionality to add,but it doesn't necessarily work the way you might expect it to.</P><P>The first thing you need to do is add a menu entry to toggle the visibility ofthe color bar. Do this through the Menu Designer, adding a new menu entry on theView menu. Specify the menu properties as shown in Table 12.5.</P><P><H4>TABLE 12.5. COLOR BAR MENU PROPERTIES.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Property</I></TD>		<TD ALIGN="LEFT"><I>Setting</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">ID_VIEW_COLORBAR		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">&amp;Color Bar		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Prompt		</TD>		<TD ALIGN="LEFT">Show or hide the colorbar\nToggle ColorBar		</TD>	</TR></TABLE><H4>Updating the Menu</H4><P>To determine whether the toolbar is visible or hidden, you can get the currentstyle of the toolbar and mask out for the WS_VISIBLE style flag. If the flag is inthe current toolbar style, then the toolbar is visible. By placing this evaluationinto the SetCheck function in the UPDATE_COMMAND_UI event message handler, you cancheck and uncheck the color bar menu entry as needed.</P><P>To add this functionality to your drawing program, add an event handler for theUPDATE_COMMAND_UI event message on the ID_VIEW_COLOR menu. Be sure to add this event-handlerfunction into the CMainFrame class. (You're still making all of your coding changesso far in the frame class.) Edit the event-handler function, adding the code in Listing12.2.</P><P><H4>LISTING 12.2. THE MODIFIED CMainFrame.OnUpdateViewColorbar FUNCTION.</H4><PRE> 1: void CMainFrame::OnUpdateViewColorbar(CCmdUI* pCmdUI) 2: { 3:     // TODO: Add your command update UI handler code here 4:     /////////////////////// 5:     // MY CODE STARTS HERE 6:     /////////////////////// 7:  8:     // Check the state of the color toolbar 9:     pCmdUI-&gt;SetCheck(((m_wndColorBar.GetStyle() &amp; WS_VISIBLE) != 0));10: </PRE><PRE>11:     ///////////////////////</PRE><PRE>12:     // MY CODE ENDS HERE13:     ///////////////////////14: }</PRE><H4>Toggling the Toolbar Visibility</H4><P>Because the CToolBar class is derived from the CWnd class (via the CControlBarclass), you might think that you could call the ShowWindow function on the toolbaritself to show and hide the toolbar. Well, you can, but the background for the toolbarwill not be hidden along with the toolbar. All the user would notice is the toolbarbuttons appearing and disappearing. (Of course, this might be the effect you areafter, but your users might not like it.)</P><P>Instead, you use a frame window function, ShowControlBar, to show and hide thetoolbar. This function takes three arguments. The first argument is the address forthe toolbar variable. The second argument is a boolean, specifying whether to showthe toolbar. (TRUE shows the toolbar; FALSE hides the toolbar.) Finally, the thirdargument specifies whether to delay showing the toolbar. (TRUE delays showing thetoolbar; FALSE shows the toolbar immediately.)</P><P>Once a toolbar is toggled on or off, you need to call another frame window function,RecalcLayout. This function causes the frame to reposition all of the toolbars, statusbars, and anything else that is within the frame area. This is the function thatcauses the color toolbar to move up and down if you toggle the default toolbar onand off.</P><P>To add this functionality to your drawing program, add an event handler for theCOMMAND event message on the ID_VIEW_COLOR menu. Be sure to add this event-handlerfunction into the CMainFrame class. (You're still making all of your coding changesso far in the frame class.) Edit the event-handler function, adding the code in Listing12.3.</P><P><H4>LISTING 12.3. THE MODIFIED CMainFrame.OnViewColorbar FUNCTION.</H4><PRE> 1: void CMainFrame::OnViewColorbar() 2: { 3:     // TODO: Add your command handler code here 4:  5:     /////////////////////// 6:     // MY CODE STARTS HERE 7:     /////////////////////// 8:     BOOL bVisible; 9: 10:     // Check the state of the color toolbar11:     bVisible = ((m_wndColorBar.GetStyle() &amp; WS_VISIBLE) != 0);12: 13:     // Toggle the color bar14:     ShowControlBar(&amp;m_wndColorBar, !bVisible, FALSE);15:     // Reshuffle the frame layout16:     RecalcLayout();17: 18:     ///////////////////////19:     // MY CODE ENDS HERE20:     ///////////////////////21: }</PRE><P>At this point, after compiling and running your application, you should be ableto toggle your color toolbar on and off using the View menu.</P><P><H2><A NAME="Heading6"></A>Adding a Combo Box to a Toolbar</H2><P>It's commonplace now to use applications that have more than just buttons on toolbars.Look at the Visual C++ Developer Studio, for example. You've got combo boxes thatenable you to navigate through your code by selecting the class, ID, and functionto edit right on the toolbar. So how do you add a combo box to a toolbar? It's notavailable in the toolbar designer; all you have there are buttons that you can painticons on. You can't add a combo box to any toolbar by using any of the Visual C++wizards. You have to write a little C++ code to do it.</P><P>To learn how to add a combo box to a toolbar, you'll add a combo box to the colortoolbar you just created. The combo box will be used to select the width of the penthe user will use to draw images. (If you haven't added the support for differentdrawing widths from the exercise at the end of Day 10, you might want to go backand add that now.)</P><P><H3><A NAME="Heading7"></A>Editing the Project Resources</H3><P>To add a combo box to your toolbar, the first thing that you need to do is whatVisual C++ was designed to prevent you from having to do. You need to edit the resourcefile yourself. You cannot do this through the Visual C++ Developer Studio. If youtry to open the resource file in the Developer Studio, you will be popped into theResource View tab of the workspace pane, editing the resource file through the variousresource editors and designers. No, you'll have to edit this file in another editor,such as Notepad.</P><P>Close Visual C++, the only way to guarantee that you don't write over your changes.Open Notepad and navigate to your project directory. Open the resource file, whichis named after the project with a .rc filename extension. Once you open this filein Notepad, scroll down until you find the toolbar definitions. (You can search forthe word &quot;toolbar.&quot;) Once you've found the toolbar definitions, go to theend of the Color toolbar definition and add two separator lines at the bottom ofthe toolbar definition.</P><P>For instance, to make these changes to your drawing application, you need to navigateto the Toolbar project directory and then open the Toolbar.rc file. (If you are addingthese toolbars to the MDI drawing application, you need to look for the Day11.rcfile.) Search for the toolbar section, and then add two SEPARATOR lines just beforethe end of the IDR_TBCOLOR section, as shown in Listing 12.4. Once you add thesetwo lines, save the file, exit Notepad, and restart Visual C++, reloading the project.</P><P><H4>LISTING 12.4. THE MODIFIED PROJECT RESOURCE FILE (Toolbar.rc).</H4><PRE> 1: ////////////////////////////////////////////////////////////////////// 2: // 3: // Toolbar 4: // 5:  6: IDR_MAINFRAME TOOLBAR DISCARDABLE  16, 15 7: BEGIN 8:     BUTTON      ID_FILE_NEW 9:     BUTTON      ID_FILE_OPEN10:     BUTTON      ID_FILE_SAVE11:     SEPARATOR12:     BUTTON      ID_EDIT_CUT13:     BUTTON      ID_EDIT_COPY14:     BUTTON      ID_EDIT_PASTE15:     SEPARATOR16:     BUTTON      ID_FILE_PRINT17:     BUTTON      ID_APP_ABOUT18: END19: 20: IDR_TBCOLOR TOOLBAR DISCARDABLE  16, 1521: BEGIN22:     BUTTON      ID_COLOR_BLACK23:     BUTTON      ID_COLOR_BLUE24:     BUTTON      ID_COLOR_GREEN25:     BUTTON      ID_COLOR_CYAN26:     BUTTON      ID_COLOR_RED27:     BUTTON      ID_COLOR_MAGENTA28:     BUTTON      ID_COLOR_YELLOW29:     BUTTON      ID_COLOR_WHITE30:     SEPARATOR31:     SEPARATOR32: END</PRE><P>You added these two SEPARATOR lines in the toolbar definition so that the secondseparator can act as a place holder for the combo box that you are going to add tothe toolbar. There are two reasons that you had to make this edit by hand and notuse the Visual C++ toolbar designer. The first reason is that the toolbar designerwould not allow you to add more than one separator to the end of the toolbar. Thesecond reason is that, if you don't add anything else on the end of your toolbarafter the separator, the toolbar designer decides that the separator is a mistakeand removes it for you. In other words, the Visual C++ toolbar designer does notallow you to add the place holder for the combo box to your toolbar.</P><P>Next, you need to add the text strings that you will load into your combo box.To add these strings, you need to open the string table in the Resource View of theworkspace pane. Here you find all of the strings that you entered as prompts in variousproperties dialogs. This table has a number of IDs, the values of those IDs, andtextual strings that are associated with those IDs, as shown in Figure 12.4. You'llneed to add the strings to be placed into your toolbar combo box in the string table;each line in the drop-down list must have a unique ID and entry in the strings table.</P><P><A HREF="javascript:popUp('12fig04tif.gif')"><B>FIGURE 12.4.</B></A><B> </B><I>Thestring table editor.</I></P><P>For instance, to add the strings for the combo box that you will be adding tothe color toolbar, insert a new string, either by selecting Insert|New String fromthe menu or by right-clicking the string table and selecting New String from thepop-up menu.</P><P>In the String properties dialog, specify a string ID for the string and then enterthe string to appear in the drop-down list. Close the properties dialog to add thestring. For the strings in the Width combo box that you are going to add to the colortoolbar, add the strings in Table 12.6.</P><P><H4>TABLE 12.6. WIDTH TOOLBAR COMBO BOX STRINGS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>ID</I></TD>		<TD ALIGN="LEFT"><I>Caption</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDS_WIDTH_VTHIN		</TD>		<TD ALIGN="LEFT">Very Thin		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDS_WIDTH_THIN		</TD>		<TD ALIGN="LEFT">Thin		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDS_WIDTH_MEDIUM		</TD>		<TD ALIGN="LEFT">Medium		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDS_WIDTH_THICK		</TD>		<TD ALIGN="LEFT">Thick		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDS_WIDTH_VTHICK		</TD>		<TD ALIGN="LEFT">Very Thick		</TD>	</TR></TABLE><H3><A NAME="Heading8"></A>Creating the Toolbar Combo Box</H3><P>Before you can add the combo box to the color toolbar, you need to create a combobox variable that you can use for the combo box. Because you are not able to addthis combo box through any of the designers, you need to add it as a variable tothe CMainFrame class.</P><P>To add the combo box variable to the main frame class for the color toolbar, selectthe Class View tab in the workspace pane. Right-click the CMainFrame class and selectAdd Member Variable from the pop-up menu. Specify the variable type as CComboBox,the name as m_ctlWidth, and the access as protected.</P><P>Once you add the combo box variable to the main frame class, you need to performa series of actions, all once the toolbar has been created:</P><P><DL>	<DT></DT>	<DD><B>1. </B>Set the width and the ID of the combo box place holder on the toolbar	to the width and ID of the combo box.	<P>	<DT></DT>	<DD><B>2. </B>Get the position of the toolbar placeholder and use it to size and	position the combo box.	<P>	<DT></DT>	<DD><B>3. </B>Create the combo box, specifying the toolbar as the parent window of	the combo box.	<P>	<DT></DT>	<DD><B>4. </B>Load the strings into the drop-down list on the combo box.	<P></DL><P>To organize this so that it doesn't get too messy, it might be advisable to movethe creation of the color toolbar to its own function that can be called from theOnCreate function of the main frame class. To create this function, right-click theCMainFrame class in the workspace pane and select Add Member Function from the pop-upmenu. Specify the function type as BOOL, the function description as CreateColorBar,and the access as public. Edit the new function, adding the code in Listing 12.5.</P><P><H4>LISTING 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91传媒视频在线播放| 欧美精品一区二区三区很污很色的| 亚洲福利视频一区| 中文字幕巨乱亚洲| 欧美区在线观看| 国产a精品视频| 蜜臀av国产精品久久久久| 亚洲视频在线一区| 国产日韩亚洲欧美综合| 欧美一区二区三区四区高清| 一本到一区二区三区| 精品一区中文字幕| 日韩国产欧美视频| 又紧又大又爽精品一区二区| 久久久久久久久伊人| 日韩精品自拍偷拍| 欧美日韩成人综合天天影院| 91香蕉视频在线| 成人免费视频免费观看| 国产一级精品在线| 国产自产2019最新不卡| 日韩电影在线一区| 日韩高清在线电影| 亚洲成av人片观看| 国产精品国产a| 欧美一区二区三区在线看| 成人一区二区三区视频| 欧美国产国产综合| 欧美日韩亚洲另类| 成人午夜视频网站| 国产黑丝在线一区二区三区| 久久国产精品第一页| 日韩电影一区二区三区四区| 亚洲成av人片| 日韩1区2区3区| 久久91精品久久久久久秒播| 日韩av一级片| 日韩成人一区二区三区在线观看| 亚洲aaa精品| 日韩福利视频网| 日本欧美肥老太交大片| 久久精品999| 国产精品一二三四区| 国产成人午夜片在线观看高清观看| 国产一区二三区好的| 国产精品伊人色| 丁香婷婷深情五月亚洲| 91丝袜国产在线播放| 欧美视频一区二区在线观看| 欧美精品日韩综合在线| 日韩一区二区三| 亚洲精品在线免费观看视频| 久久久久久夜精品精品免费| 国产精品网站在线播放| 最新欧美精品一区二区三区| 亚洲精品久久7777| 亚洲成年人影院| 久久狠狠亚洲综合| 国产成人在线网站| 色综合久久九月婷婷色综合| 欧美日本一道本在线视频| 日韩精品一区国产麻豆| 国产亚洲一区二区三区四区| 亚洲欧美在线视频| 午夜精品123| 国产精品一区二区在线播放| 99在线视频精品| 欧美影视一区二区三区| 日韩精品专区在线影院观看| 国产精品久久一卡二卡| 亚洲成人激情综合网| 精品影视av免费| 99re热视频精品| 欧美一区三区二区| 国产精品毛片高清在线完整版 | 99国内精品久久| 欧美三级视频在线播放| 精品欧美黑人一区二区三区| 国产精品动漫网站| 日韩高清不卡在线| 99热在这里有精品免费| 日韩欧美一区二区久久婷婷| 中文字幕在线不卡视频| 蜜桃在线一区二区三区| 成人午夜碰碰视频| 在线不卡一区二区| 国产精品久久久久久久久免费樱桃| 午夜精品久久久久| 成人深夜在线观看| 日韩一级免费观看| 亚洲精品自拍动漫在线| 国产综合色精品一区二区三区| 在线视频综合导航| 国产日韩欧美不卡| 蜜桃视频一区二区三区在线观看| 91在线看国产| 久久亚洲精品国产精品紫薇| 亚洲第一会所有码转帖| 成人久久久精品乱码一区二区三区| 欧美精品九九99久久| 亚洲视频中文字幕| 国产精品99久久久久久久女警| 欧美日韩亚洲综合一区| 亚洲精品乱码久久久久久日本蜜臀| 国模冰冰炮一区二区| 精品视频999| 亚洲色图20p| 成人综合日日夜夜| 亚洲精品在线电影| 久久国产生活片100| 国产亚洲一二三区| 精品综合久久久久久8888| 欧美另类z0zxhd电影| 一区二区三区免费在线观看| 成人精品一区二区三区中文字幕| 精品国产污污免费网站入口 | 激情文学综合插| 欧美老女人第四色| 亚洲国产成人av网| 色www精品视频在线观看| 国产精品电影一区二区三区| 国产91精品露脸国语对白| 久久一区二区视频| 国产精品资源网| 国产亚洲精品7777| 国产成人在线网站| 国产精品午夜电影| 成人免费视频一区| 国产精品久久久久久久久免费樱桃| 国产精品99久久久久久久女警| 久久这里只精品最新地址| 久久精品72免费观看| 欧美刺激脚交jootjob| 美女视频黄 久久| 精品国产3级a| 国产剧情一区二区| 国产丝袜美腿一区二区三区| 国产一区二区久久| 久久精品视频免费观看| 处破女av一区二区| 亚洲视频免费在线观看| 色婷婷av一区| 亚洲国产综合视频在线观看| 欧美高清性hdvideosex| 美女精品一区二区| 久久青草欧美一区二区三区| 国产精品888| 亚洲色图在线视频| 91蜜桃网址入口| 一区二区三区日韩| 91精品国产色综合久久久蜜香臀| 美日韩一区二区| 精品国产1区2区3区| aaa国产一区| 亚洲国产精品久久人人爱| 欧美一区二区三区四区在线观看| 紧缚捆绑精品一区二区| 国产精品污污网站在线观看| 色欧美88888久久久久久影院| 亚洲图片自拍偷拍| 精品国产99国产精品| 成人性生交大片免费看在线播放 | 国产日本亚洲高清| jizz一区二区| 亚洲大片在线观看| 26uuu国产日韩综合| aaa欧美日韩| 免费成人在线视频观看| 欧美激情一区不卡| 欧美日韩国产小视频在线观看| 久久丁香综合五月国产三级网站| 国产欧美一区二区三区在线看蜜臀| 91福利资源站| 激情文学综合网| 亚洲九九爱视频| 日韩欧美在线1卡| 91视频在线观看| 蜜乳av一区二区| 亚洲裸体xxx| 26uuu国产一区二区三区| 色综合久久久久综合体桃花网| 蜜桃久久久久久| 亚洲手机成人高清视频| 精品久久五月天| 欧美日韩视频在线一区二区| 国产麻豆日韩欧美久久| 婷婷成人综合网| 国产精品久久久久久亚洲伦| 欧美一卡二卡三卡| 91在线精品一区二区三区| 黄网站免费久久| 天堂一区二区在线| 亚洲欧洲日韩av| 国产亚洲欧洲一区高清在线观看| 欧美体内she精高潮| 欧美日韩在线直播| 成人app软件下载大全免费| 美女脱光内衣内裤视频久久网站 | 日韩一区有码在线| 精品久久一区二区|