settitle.cpp

来自「MicroStation源代码」· C++ 代码 · 共 95 行

CPP
95
字号
/*----------------------------------------------------------------------+
|
|	SetTitle
|
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
|
|	STATUS:	WORKING
|	DATE:	03/09/1999
|
|   This example illustrates how to change the title of overall title 
|		bar, tool settings dialog, and all open view windows
|
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
|
|   Include Files
|
+----------------------------------------------------------------------*/
#include <mdl.h>        
#include <tcb.h>   
#include <cmdlist.h>  
#include <dlogids.h>
   
#include <msdialog.fdf>
#include <mssystem.fdf>	
#include <mswindow.fdf>
#include <msview.fdf>

/*----------------------------------------------------------------------+
|
|	exitApplication
|
|	author		BSI											12/98
|
+----------------------------------------------------------------------*/

Private void exitApplication
(
void
)

{
	/* Queue up a command to unload the current MDL application */
	mdlDialog_cmdNumberQueue (FALSE, CMD_MDL_UNLOAD,
							  mdlSystem_getCurrTaskID(), TRUE);
}

/*----------------------------------------------------------------------+
|									
|	main			          			
|
|	author		BSI											12/98
|									
+----------------------------------------------------------------------*/

Private int main 
(
int		argc,	/* => Number of arguments passed in argv */
char	*argv[]	/* => Array of pointers to arguments */
)	

{
	MSWindow	*mainTitle, *current;
	int 		viewP;
    DialogBox 	*dbP;


	/* Change main title */
	mainTitle	= mdlDialog_overallTitleBarGet();
	mdlWindow_titleSet (mainTitle, "- Your Custom Title -");

	/* Change Tool Settings title */
	dbP = mdlDialog_find (DIALOGID_ToolSettings, NULL);
	if (dbP)
	{
		mdlWindow_titleSet (dbP, "- Your Custom Title -");
	}

	/* Change all active view titles */
	for (current=mdlWindow_getFirst(); current; current=mdlWindow_getNext(current))	
	{
		/* Check if window is a view and view is active */
	   	if((mdlWindow_isView (&viewP, current)) && (mdlView_isActive (viewP)))
		{
			mdlWindow_titleSet (current, "- Your Custom Title -");
		}
	}

	/* Exit the current MDL application */
	exitApplication ();

	return (0);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?