Beispiel #1
0
/// Edit a custom property
void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
{
    ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
    ctConfigItem* sel = GetSelection();
    ctPropertyEditor* editor = wxGetApp().GetMainFrame()->GetPropertyEditor();
    if (doc && sel && editor)
    {
        int row;
        ctProperty* property = editor->FindSelectedProperty(row) ;
        if (property && property->IsCustom())
        {
            wxString oldName = property->GetName();
            wxString oldDescription = property->GetDescription();
            wxString oldType = property->GetVariant().GetType();
            wxString oldEditorType = property->GetEditorType();
            wxArrayString oldChoices = property->GetChoices();

            ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
                wxID_ANY, _("Edit custom property"));
            dialog.SetPropertyName(oldName);
            dialog.SetPropertyType(oldType);
            dialog.SetPropertyDescription(oldDescription);
            if (dialog.ShowModal() == wxID_OK)
            {
                wxString name = dialog.GetPropertyName();
                wxString type = dialog.GetPropertyType();
                wxString editorType = dialog.GetEditorType();
                wxArrayString choices = dialog.GetChoices();
                wxString descr = dialog.GetPropertyDescription();

                if (name != oldName && sel->GetProperties().FindProperty(name))
                {
                    wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"),
                        wxOK|wxICON_INFORMATION);
                    return;
                }
                if (type != oldType)
                {
                    if (type == wxT("bool"))
                        property->GetVariant() = wxVariant(false, name);
                    else if (type == wxT("double"))
                        property->GetVariant() = wxVariant((double) 0.0, name);
                    else if (type == wxT("long"))
                        property->GetVariant() = wxVariant((long) 0, name);
                    else
                        property->GetVariant() = wxVariant(wxEmptyString, name);
                }
                if (name != oldName)
                    property->GetVariant().SetName(name);

                if (choices != oldChoices)
                    property->SetChoices(choices);

                if (editorType != oldEditorType)
                    property->SetEditorType(editorType);

                if (name != oldName)
                    property->GetVariant().SetName(name);

                property->SetCustom(true);

                if (descr != oldDescription)
                    property->SetDescription(descr);

                editor->ShowItem(sel);
                OnChangeFilename();
            }
        }
    }
}
TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
{
	TiXmlNode* returnNode = 0;

	p = SkipWhiteSpace( p, encoding );
	if( !p || !*p || *p != '<' )
	{
		return 0;
	}

	TiXmlDocument* doc = GetDocument();
	p = SkipWhiteSpace( p, encoding );

	if ( !p || !*p )
	{
		return 0;
	}

	// What is this thing? 
	// - Elements start with a letter or underscore, but xml is reserved.
	// - Comments: <!--
	// - Decleration: <?xml
	// - Everthing else is unknown to tinyxml.
	//

	const char* xmlHeader = { "<?xml" };
	const char* commentHeader = { "<!--" };
	const char* dtdHeader = { "<!" };

	if ( StringEqual( p, xmlHeader, true, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Declaration\n" );
		#endif
		returnNode = new TiXmlDeclaration();
	}
	else if ( StringEqual( p, commentHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Comment\n" );
		#endif
		returnNode = new TiXmlComment();
	}
	else if ( StringEqual( p, dtdHeader, false, encoding ) )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Unknown(1)\n" );
		#endif
		returnNode = new TiXmlUnknown();
	}
	else if (    IsAlpha( *(p+1), encoding )
			  || *(p+1) == '_' )
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Element\n" );
		#endif
		returnNode = new TiXmlElement( "" );
	}
	else
	{
		#ifdef DEBUG_PARSER
			TIXML_LOG( "XML parsing Unknown(2)\n" );
		#endif
		returnNode = new TiXmlUnknown();
	}

	if ( returnNode )
	{
		// Set the parent, so it can report errors
		returnNode->parent = this;
	}
	else
	{
		if ( doc )
			doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
	}
	return returnNode;
}
/*! 指定拡張子のファイルに対応するファイルを開く補助関数

	@date 2003.06.28 Moca ヘッダ・ソースファイルオープン機能のコードを統合
	@date 2008.04.09 ryoji 処理対象(file_ext)と開く対象(open_ext)の扱いが逆になっていたのを修正
*/
BOOL CEditView::OPEN_ExtFromtoExt(
	BOOL			bCheckOnly,		//!< [in] true: チェックのみ行ってファイルは開かない
	BOOL			bBeepWhenMiss,	//!< [in] true: ファイルを開けなかった場合に警告音を出す
	const TCHAR*	file_ext[],		//!< [in] 処理対象とする拡張子
	const TCHAR*	open_ext[],		//!< [in] 開く対象とする拡張子
	int				file_extno,		//!< [in] 処理対象拡張子リストの要素数
	int				open_extno,		//!< [in] 開く対象拡張子リストの要素数
	const TCHAR*	errmes			//!< [in] ファイルを開けなかった場合に表示するエラーメッセージ
)
{
//From Here Feb. 7, 2001 JEPRO 追加
	int		i;
//To Here Feb. 7, 2001

	/* 編集中ファイルの拡張子を調べる */
	for( i = 0; i < file_extno; i++ ){
		if( CheckEXT( GetDocument()->m_cDocFile.GetFilePath(), file_ext[i] ) ){
			goto open_c;
		}
	}
	if( bBeepWhenMiss ){
		ErrorBeep();
	}
	return FALSE;

open_c:;

	TCHAR	szPath[_MAX_PATH];
	TCHAR	szDrive[_MAX_DRIVE];
	TCHAR	szDir[_MAX_DIR];
	TCHAR	szFname[_MAX_FNAME];
	TCHAR	szExt[_MAX_EXT];
	HWND	hwndOwner;

	_tsplitpath( GetDocument()->m_cDocFile.GetFilePath(), szDrive, szDir, szFname, szExt );

	for( i = 0; i < open_extno; i++ ){
		_tmakepath( szPath, szDrive, szDir, szFname, open_ext[i] );
		if( !fexist(szPath) ){
			if( i < open_extno - 1 )
				continue;
			if( bBeepWhenMiss ){
				ErrorBeep();
			}
			return FALSE;
		}
		break;
	}
	if( bCheckOnly ){
		return TRUE;
	}

	/* 指定ファイルが開かれているか調べる */
	/* 開かれている場合は開いているウィンドウのハンドルも返す */
	/* ファイルを開いているか */
	if( CShareData::getInstance()->IsPathOpened( szPath, &hwndOwner ) ){
	}else{
		/* 文字コードはこのファイルに合わせる */
		SLoadInfo sLoadInfo;
		sLoadInfo.cFilePath = szPath;
		sLoadInfo.eCharCode = GetDocument()->GetDocumentEncoding();
		sLoadInfo.bViewMode = false;
		CControlTray::OpenNewEditor(
			G_AppInstance(),
			this->GetHwnd(),
			sLoadInfo,
			NULL,
			true
		);
		/* ファイルを開いているか */
		if( CShareData::getInstance()->IsPathOpened( szPath, &hwndOwner ) ){
		}else{
			// 2011.01.12 ryoji エラーは表示しないでおく
			// ファイルサイズが大きすぎて読むかどうか問い合わせているような場合でもエラー表示になるのは変
			// OpenNewEditor()または起動された側のメッセージ表示で十分と思われる

			//ErrorMessage( this->GetHwnd(), _T("%ts\n\n%ts\n\n"), errmes, szPath );
			return FALSE;
		}
	}
	/* アクティブにする */
	ActivateFrameWindow( hwndOwner );

// 2004/06/21 novice タグジャンプ機能追加
// 2004/07/09 genta/Moca タグジャンプバックの登録が取り除かれていたが、
//            こちらでも従来どおり登録する
	TagJump	tagJump;
	/*
	  カーソル位置変換
	  レイアウト位置(行頭からの表示桁位置、折り返しあり行位置)
	  →
	  物理位置(行頭からのバイト数、折り返し無し行位置)
	*/
	GetDocument()->m_cLayoutMgr.LayoutToLogic(
		GetCaret().GetCaretLayoutPos(),
		&tagJump.point
	);
	tagJump.hwndReferer = CEditWnd::getInstance()->GetHwnd();
	// タグジャンプ情報の保存
	CTagJumpManager().PushTagJump(&tagJump);
	return TRUE;
}
const char* TTiXmlElement::Parse( const char* p, TTiXmlParsingData* data, TTiXmlEncoding encoding )
{
	p = SkipWhiteSpace( p, encoding );
	TTiXmlDocument* document = GetDocument();

	if ( !p || !*p )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding );
		return 0;
	}

	if ( data )
	{
		data->Stamp( p, encoding );
		location = data->Cursor();
	}

	if ( *p != '<' )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding );
		return 0;
	}

	p = SkipWhiteSpace( p+1, encoding );

	// Read the name.
	const char* pErr = p;

    p = ReadName( p, &value, encoding );
	if ( !p || !*p )
	{
		if ( document )	document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding );
		return 0;
	}

    TIXML_STRING endTag ("</");
	endTag += value;

	// Check for and read attributes. Also look for an empty
	// tag or an end tag.
	while ( p && *p )
	{
		pErr = p;
		p = SkipWhiteSpace( p, encoding );
		if ( !p || !*p )
		{
			if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
			return 0;
		}
		if ( *p == '/' )
		{
			++p;
			// Empty tag.
			if ( *p  != '>' )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding );		
				return 0;
			}
			return (p+1);
		}
		else if ( *p == '>' )
		{
			// Done with attributes (if there were any.)
			// Read the value -- which can include other
			// elements -- read the end tag, and return.
			++p;
			p = ReadValue( p, data, encoding );		// Note this is an Element method, and will set the error if one happens.
			if ( !p || !*p ) {
				// We were looking for the end tag, but found nothing.
				// Fix for [ 1663758 ] Failure to report error on bad XML
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}

			// We should find the end tag now
			// note that:
			// </foo > and
			// </foo> 
			// are both valid end tags.
			if ( StringEqual( p, endTag.c_str(), false, encoding ) )
			{
				p += endTag.length();
				p = SkipWhiteSpace( p, encoding );
				if ( p && *p && *p == '>' ) {
					++p;
					return p;
				}
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}
			else
			{
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}
		}
		else
		{
			// Try to read an attribute:
			TTiXmlAttribute* attrib = new TTiXmlAttribute();
			if ( !attrib )
			{
				return 0;
			}

			attrib->SetDocument( document );
			pErr = p;
			p = attrib->Parse( p, data, encoding );

			if ( !p || !*p )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
				delete attrib;
				return 0;
			}

			// Handle the strange case of double attributes:
			#ifdef TIXML_USE_STL
			TTiXmlAttribute* node = attributeSet.Find( attrib->NameTStr() );
			#else
			TTiXmlAttribute* node = attributeSet.Find( attrib->Name() );
			#endif
			if ( node )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
				delete attrib;
				return 0;
			}

			attributeSet.Add( attrib );
		}
	}
	return p;
}
const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
{
	p = SkipWhiteSpace( p, encoding );
	TiXmlDocument* document = GetDocument();

	if ( !p || !*p )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding );
		return 0;
	}

//	TiXmlParsingData data( p, prevData );
	if ( data )
	{
		data->Stamp( p, encoding );
		location = data->Cursor();
	}

	if ( *p != '<' )
	{
		if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding );
		return 0;
	}

	p = SkipWhiteSpace( p+1, encoding );

	// Read the name.
	const char* pErr = p;

    p = ReadName( p, &value, encoding );
	if ( !p || !*p )
	{
		if ( document )	document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding );
		return 0;
	}

    TIXML_STRING endTag ("</");
	endTag += value;
	endTag += ">";

	// Check for and read attributes. Also look for an empty
	// tag or an end tag.
	while ( p && *p )
	{
		pErr = p;
		p = SkipWhiteSpace( p, encoding );
		if ( !p || !*p )
		{
			if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
			return 0;
		}
		if ( *p == '/' )
		{
			++p;
			// Empty tag.
			if ( *p  != '>' )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding );		
				return 0;
			}
			return (p+1);
		}
		else if ( *p == '>' )
		{
			// Done with attributes (if there were any.)
			// Read the value -- which can include other
			// elements -- read the end tag, and return.
			++p;
			p = ReadValue( p, data, encoding );		// Note this is an Element method, and will set the error if one happens.
			if ( !p || !*p )
				return 0;

			// We should find the end tag now
			if ( StringEqual( p, endTag.c_str(), false, encoding ) )
			{
				p += endTag.length();
				return p;
			}
			else
			{
				if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
				return 0;
			}
		}
		else
		{
			// Try to read an attribute:
			TiXmlAttribute* attrib = new TiXmlAttribute();
			if ( !attrib )
			{
				if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, pErr, data, encoding );
				return 0;
			}

			attrib->SetDocument( document );
			const char* pErr = p;
			p = attrib->Parse( p, data, encoding );

			if ( !p || !*p )
			{
				if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
				delete attrib;
				return 0;
			}

			// Handle the strange case of double attributes:
			TiXmlAttribute* node = attributeSet.Find( attrib->Name() );
			if ( node )
			{
				node->SetValue( attrib->Value() );
				delete attrib;
				return 0;
			}

			attributeSet.Add( attrib );
		}
	}
	return p;
}
Beispiel #6
0
void CResFormView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	// TODO: Add your specialized code here and/or call the base class
	//Invalidate (FALSE) ;
	SetWindowText (_T("BLIPPY") );
	CString tempstring ;

	CNewestDoc *cnd = (CNewestDoc *) GetDocument () ;
	CDC *cdc = m_statRimProf.GetDC () ;
	if (cnd->rimprof_npts) MakeProfile () ;
	UpdateData (FALSE) ;

	if (lHint == 17) CleanUp () ;

	if (cnd->Centerflag) {
		m_strLocationString.Format ("Crater : \t%s\r\nX : %5d    \t\tY : %5d\r\nLon : %8.4f   \tLat : %7.4f\r\n",
			cnd->cratername, cnd->center.x, cnd->center.y, cnd->center_lon, 
			cnd->center_lat) ;
		tempstring.Format ("Pixel Dimension (m) : \t%9.1f\r\nPixel Area  (m2) : \t%9.0f\r\n", 
			cnd->pixdim_avg, cnd->pixsize) ;
		m_strLocationString += tempstring ;
	}

	if (cnd->SFitflag) {
		m_strSurftext.Format ("UNAFFECTED SURFACE FITTING\r\nNumber of Tiepoints : \t\t%5d\r\n",
			cnd->nTiepts) ;
		tempstring.Format ("Tiepts Resids Std Deviation : \t%9.1f\r\nTiepts R2 :  \t\t\t%5.2f \r\n",
			cnd->tiepts_stdev, cnd->tiepts_r2)   ;
		m_strSurftext += tempstring ;
	}

	if (cnd->Rimflag ) {
		m_strCratRim.Format ("CRATER STATISTICS\r\nApprox. Diam (km) : \t\t%9.1f\r\nMax Depth : \t\t\t%9.1f\r\nAvg Depth :\t\t\t%9.1f\r\nMed Depth : \t\t\t%9.1f\r\n",
			cnd->ctr_diam / 1.E3, -cnd->ctr_max_depth_all, -cnd->ctr_ave_depth_all, -cnd->ctr_median_depth) ;
		
		tempstring.Format ("Total Area (km2): \t\t%9.1f\r\nVol (only pxls below) (km3):\t%9.1f\r\n", 
			cnd->ctr_area * cnd->pixsize / 1.E6, cnd->ctr_vol * cnd->pixsize / 1.E9) ;
		m_strCratRim += tempstring ;


		tempstring.Format ("\r\nRIM PROFILE STATISTICS\r\nMax Height (m):  \t\t%9.1f\r\n",
			cnd->rimprof_max) ;

		m_strCratRim += tempstring ;
		tempstring.Format ("Avg Height : \t\t\t%9.1f\r\nMed Height : \t\t\t%9.1f\r\nAvg Height to Crater Max Depth :  %9.1f\r\nAvg Height to Crater Avg Depth :  %9.1f\r\n", 
			cnd->rimprof_avg, cnd->rimprof_med, cnd->rimprof_avg - cnd->ctr_max_depth_all, cnd->rimprof_avg - cnd->ctr_ave_depth_all) ;
		m_strCratRim += tempstring ;
	}

	if (cnd->RimInnerflag) {
		tempstring.Format ("\r\nRIM VOLUME STATISTICS\r\nArea (km2):   \t\t\t%9.1f\r\nVolume (km3):  \t\t\t%9.1f\r\n",
			cnd->rim_npix * cnd->pixsize / 1.E6, cnd->rim_vol * cnd->pixsize / 1.E9) ;
		m_strCratRim += tempstring ;
		
	}


	if (cnd->Innerflag) {
		m_strInner.Format ("INNER LOBE STATISTICS\r\nMax Thickness : \t%9.1f\r\n",
			cnd->inner_max) ;
		tempstring.Format ("Avg Thickness  : \t%9.1f\r\nMed Thickness : \t%9.1f\r\n",
			cnd->inner_avg, cnd->inner_median) ;
		m_strInner += tempstring ;
		tempstring.Format ("Area (km2) :\t\t%9.1f\r\nVolume (km3) :\t\t%9.1f\r\n", cnd->inner_npix_all * cnd->pixsize / 1.E6,
			cnd->inner_vol * cnd->pixsize / 1.E9) ;
		m_strInner += tempstring ;
	}
	if (cnd->Outerflag ) {
		m_strOuter.Format ("OUTER LOBE STATISTICS\r\nMax Thickness : \t%9.1f\r\n",
			cnd->outer_max) ;
		tempstring.Format ("Avg Thickness  : \t%9.1f\r\nMed Thickness  : \t%9.1f\r\n",
			cnd->outer_avg, cnd->outer_median) ;
		m_strOuter += tempstring ;
		tempstring.Format ("Area (km2) :\t\t%9.1f\r\nVolume (km3) :\t\t%9.1f\r\n", cnd->outer_npix_all * cnd->pixsize / 1.E6,
			cnd->outer_vol * cnd->pixsize / 1.E9) ;
		m_strOuter += tempstring ;
	}



	Invalidate (FALSE) ;
}
Beispiel #7
0
void
MFCArrangeView::EditorContextMenu(CPoint &point, UINT nFlags)
{
	Time	at_time;
//	short	at_note = Pix2Note(point.y);
	Pix2Time(point.x, at_time);

	CPoint		popPt = point;
	ClientToScreen(&popPt);

	CMenu		*ctxtMenu = new CMenu;
	ctxtMenu->CreatePopupMenu();
	short	i=0;
	char	buf[128];
	short	hitType;
	void	*hitIt=NULL;
	CPoint	itPt = point;
	itPt += GetScrollPosition();

	MFCInstanceView		*instv=NULL;
	Instance			*inst=NULL;
	MFCEditorItemView	*iv=NULL;
	long				nEnvelope=0;
	bool				add_dflt_items = true;
	bool				added_items = false;
	vector<Envelope *> envelopes;
	if ((instv= InstanceViewAtPoint(itPt))!=NULL) {
		add_dflt_items = true;
		added_items = true;
		inst = instv->instance;
		if (inst) {
			CMenu		*envMenu = new CMenu;
			envMenu->CreatePopupMenu();

			envelopes = quaLink->ListEnvelopesFor(inst->sym);
			nEnvelope = envelopes.size();
			string buf =  "Envelopes for '" + inst->sym->name + "'";
			ctxtMenu->AppendMenu(MF_POPUP, (UINT) envMenu->m_hMenu, buf.c_str());
//			for each variable
//				envMenu->AppendMenu(MF_STRING, ID_EDIT_SHOW_ENVELOPE, variable name);
//					tick state
		}
	} else if ((iv  = ItemViewAtPoint(itPt, nFlags|MK_CONTROL, hitType, hitIt)) != NULL) {
		if (iv->type == MFCEditorItemView::LIST) {
		} else if (iv->type == MFCEditorItemView::DISCRETE) {
		} else if (iv->type == MFCEditorItemView::CLIP) {
			add_dflt_items = true;
			added_items = true;
			MFCClipItemView	*civ = (MFCClipItemView*)iv;
			Clip	*c = civ->item;
			bool	ismark = false;
			if (c && c->duration.ticks <= 0) {
				ismark = true;
			}
			ctxtMenu->AppendMenu(MF_STRING, ID_EDITORCONTEXT_DEL_CLIP, ismark? "Delete Marker":"Delete Region");
		} else if (iv->type == MFCEditorItemView::ENV) {
		} else {
		}
	}

	if (add_dflt_items) { // run with the default menu
		if (added_items) {
			ctxtMenu->AppendMenu(MF_SEPARATOR);
		}
		ctxtMenu->AppendMenu(MF_STRING, ID_EDIT_ADD_CLIP, "Add Region");
		ctxtMenu->AppendMenu(MF_STRING, ID_EDIT_ADD_MARKER, "Add Marker");
	}

	short ret = ctxtMenu->TrackPopupMenuEx(
						TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RETURNCMD,
						popPt.x, popPt.y, this, NULL);
	delete ctxtMenu;
	if (ret == 0) {	// cancel
		return;
	}

	CQuaMFCDoc	*qdoc = (CQuaMFCDoc *)GetDocument();
	if (qdoc == NULL) {
		fprintf(stderr, "menu item track finds null doc");
		return;
	} else if (qdoc->qua == NULL) {
		fprintf(stderr, "menu item track finds null sequencer");
	}
	if (ret == ID_EDIT_ADD_CLIP || ret == ID_EDIT_ADD_MARKER) {
		StabEnt	*qSym = qdoc->qua->sym;
		if (qSym) {
			Time	dur_time;
			string nm;
			if (ret == ID_EDIT_ADD_CLIP) {
				dur_time.Set(1,0,0,at_time.metric);
				nm = glob.makeUniqueName(qSym, "region", 1);
			} else {
				dur_time.ticks = 0;
				nm = glob.makeUniqueName(qSym, "marker", 1);
			}
			Clip	*c = qdoc->qua->addClip(nm, at_time, dur_time, true);
//			MFCEditorItemView	*added_item = AddClipItemView(c);
		}
	} else if (ret == ID_EDITORCONTEXT_DEL_CLIP || ret == ID_EDITORCONTEXT_DEL_MARKER) {
		StabEnt	*qSym = qdoc->qua->sym;
		if (iv != NULL && qSym) {
			Sample	*v;
			MFCClipItemView	*civ = (MFCClipItemView*)iv;
			if (civ->item != NULL) {
				Clip	*c = civ->item;
				fprintf(stderr, "remove clip %x\n", c);
//				DelClipItemView(iv);
				qdoc->qua->removeClip(c, true);
			}
		}
	} else if (ret >= ID_EDIT_SHOW_ENVELOPE && ret < ID_EDIT_SHOW_ENVELOPE+nEnvelope) {
		if (inst != NULL) {
			long		ind = ret-ID_EDIT_SHOW_ENVELOPE;
			StabEnt		*envSym = envelopes[ind]->sym;
			if (envSym) {
				long  nSegs = qdoc->qua->CountEnvelopeSegments(
													inst->sym, envSym);
				EnvelopeSegment		*segs = new EnvelopeSegment[nSegs];

				qdoc->qua->FetchEnvelopeSegments(inst->sym, envSym, nSegs, segs);

				delete segs;
			}
		}
	}
}
Beispiel #8
0
BOOL CView::DoPrintPreview(UINT nIDResource, CView* pPrintView,
	CRuntimeClass* pPreviewViewClass, CPrintPreviewState* pState)
{
	ASSERT_VALID_IDR(nIDResource);
	ASSERT_VALID(pPrintView);
	ASSERT(pPreviewViewClass != NULL);
	ASSERT(pPreviewViewClass->IsDerivedFrom(RUNTIME_CLASS(CPreviewView)));
	ASSERT(pState != NULL);

	CFrameWnd* pParent = (CFrameWnd*)AfxGetThread()->m_pMainWnd;
	ASSERT_VALID(pParent);
	ASSERT_KINDOF(CFrameWnd, pParent);

	CCreateContext context;
	context.m_pCurrentFrame = pParent;
	context.m_pCurrentDoc = GetDocument();
	context.m_pLastView = this;

	// Create the preview view object
	CPreviewView* pView = (CPreviewView*)pPreviewViewClass->CreateObject();
	if (pView == NULL)
	{
		TRACE0("Error: Failed to create preview view.\n");
		return FALSE;
	}
	ASSERT_KINDOF(CPreviewView, pView);
	pView->m_pPreviewState = pState;        // save pointer

	pParent->OnSetPreviewMode(TRUE, pState);    // Take over Frame Window

#ifdef _MAC
	if (nIDResource == AFX_IDD_PREVIEW_TOOLBAR)
	{
		HINSTANCE hInst = AfxFindResourceHandle(
			MAKEINTRESOURCE(AFX_IDD_PREVIEW_TOOLBAR), RT_DIALOG);
		HRSRC hResource = FindResource(hInst,
			MAKEINTRESOURCE(AFX_IDD_PREVIEW_TOOLBAR), RT_DIALOG);

		HGLOBAL hdt = NULL;
		if (hResource != NULL)
			hdt = LoadResource(hInst, hResource);

		DLGTEMPLATE* pdt = NULL;
		if (hdt != NULL)
			pdt = (DLGTEMPLATE*)LockResource(hdt);

		if (pdt != NULL)
		{
			CRect rectParent;
			pParent->GetClientRect(&rectParent);

			int cxToolbar = MulDiv(LOWORD(GetDialogBaseUnits()), pdt->cx, 4);

			if (cxToolbar > rectParent.Width())
				nIDResource = AFX_IDD_PREVIEW_SHORTTOOLBAR;

			UnlockResource(hdt);
			FreeResource(hdt);
		}
	}
#endif

	// Create the toolbar from the dialog resource
	pView->m_pToolBar = new CDialogBar;
	if (!pView->m_pToolBar->Create(pParent, MAKEINTRESOURCE(nIDResource),
		CBRS_TOP, AFX_IDW_PREVIEW_BAR))
	{
		TRACE0("Error: Preview could not create toolbar dialog.\n");
		pParent->OnSetPreviewMode(FALSE, pState);   // restore Frame Window
		delete pView->m_pToolBar;       // not autodestruct yet
		pView->m_pToolBar = NULL;
		pView->m_pPreviewState = NULL;  // do not delete state structure
		delete pView;
		return FALSE;
	}
	pView->m_pToolBar->m_bAutoDelete = TRUE;    // automatic cleanup

	// Create the preview view as a child of the App Main Window.  This
	// is a sibling of this view if this is an SDI app.  This is NOT a sibling
	// if this is an MDI app.

	if (!pView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
		CRect(0,0,0,0), pParent, AFX_IDW_PANE_FIRST, &context))
	{
		TRACE0("Error: couldn't create preview view for frame.\n");
		pParent->OnSetPreviewMode(FALSE, pState);   // restore Frame Window
		pView->m_pPreviewState = NULL;  // do not delete state structure
		delete pView;
		return FALSE;
	}

	// Preview window shown now

	pState->pViewActiveOld = pParent->GetActiveView();
	CView* pActiveView = pParent->GetActiveFrame()->GetActiveView();
	if (pActiveView != NULL)
		pActiveView->OnActivateView(FALSE, pActiveView, pActiveView);

	if (!pView->SetPrintView(pPrintView))
	{
		pView->OnPreviewClose();
		return TRUE;            // signal that OnEndPrintPreview was called
	}

	pParent->SetActiveView(pView);  // set active view - even for MDI

	// update toolbar and redraw everything
	pView->m_pToolBar->SendMessage(WM_IDLEUPDATECMDUI, (WPARAM)TRUE);
	pParent->RecalcLayout();            // position and size everything
	pParent->UpdateWindow();

	return TRUE;
}
/// Command Events
///< This code demonstrates how to parse a loaded Power Tab document
///< You could also load a document directly using Load
void PowerTabView::OnTestParseFile(wxCommandEvent& event)
{
    // Menu Test -> Parse File
    //------Last Checked------//
    // - Jan 25, 2005
    WXUNUSED(event);
    
    // Get the active document
    PowerTabDocument* document = (PowerTabDocument*)GetDocument();
    wxCHECK2(document != NULL, return);
    
    wxLongLong startTime = ::wxGetLocalTimeMillis();
    
    // Get the header
    PowerTabFileHeader& header = document->GetHeaderRef();
    
    // File version that the file was saved as; the document automatically
    // converts to the latest version during deserialization
    wxWord version = header.GetVersion();

    // In Power Tab Editor v1.7, most of the header data is accessable via the Song Property Sheet:
    // Menu View -> File Information
    // Menu View -> Performance Notes
    // Menu View -> Lyrics
    
    // File is a song
    if (header.IsSong())
    {              
        wxByte contentType = header.GetSongContentType();
        wxString title = header.GetSongTitle();
        wxString artist = header.GetSongArtist();
        
        wxByte releaseType = header.GetSongReleaseType();

        // Audio release     
        if (releaseType == PowerTabFileHeader::RELEASETYPE_PUBLIC_AUDIO)
        {
            wxByte releaseType = header.GetSongAudioReleaseType();
            wxString releaseTitle = header.GetSongAudioReleaseTitle();
            wxWord year = header.GetSongAudioReleaseYear();
            bool live = header.IsSongAudioReleaseLive();
        }
        // Video release
        else if (releaseType == PowerTabFileHeader::RELEASETYPE_PUBLIC_VIDEO)
        {
            wxString releaseTitle = header.GetSongVideoReleaseTitle();
            bool live = header.IsSongVideoReleaseLive();
        }
        // Bootleg
        else if (releaseType == PowerTabFileHeader::RELEASETYPE_BOOTLEG)
        {
            wxString releaseTitle = header.GetSongBootlegTitle();
            wxDateTime bootlegDate = header.GetSongBootlegDate();
        }
        // Not released
        else if (releaseType == PowerTabFileHeader::RELEASETYPE_NOTRELEASED)
        {
            // no extra data for this data
        }
                        
        // If author is known, get the composer and lyricist; otherwise, song is traditional
        if (header.GetSongAuthorType() == PowerTabFileHeader::AUTHORTYPE_AUTHORKNOWN)
        {
            wxString composer = header.GetSongComposer();
            wxString lyricist = header.GetSongLyricist();
        }
        
        wxString arranger = header.GetSongArranger();
        
        wxString guitarScoreTranscriber = header.GetSongGuitarScoreTranscriber();
        wxString bassScoreTranscriber = header.GetSongBassScoreTranscriber();
        
        wxString copyright = header.GetSongCopyright();
                   
        wxString lyrics = header.GetSongLyrics();
        
        wxString guitarScoreNotes = header.GetSongGuitarScoreNotes();
        wxString bassScoreNotes = header.GetSongBassScoreNotes();
    }
    // File is a lesson
    else if (header.IsLesson())
    {
        wxString title = header.GetLessonTitle();
        wxString subtitle = header.GetLessonSubtitle();
        wxWord musicStyle = header.GetLessonMusicStyle();
        wxByte level = header.GetLessonLevel();
        wxString author = header.GetLessonAuthor();
        wxString notes = header.GetLessonNotes();
        wxString copyright = header.GetLessonCopyright();
    }
    
    wxUint8 scoreIndex = 0;
    // There are two scores in each document:
    // 1) Guitar score
    // 2) Bass score
    for (; scoreIndex < 2; scoreIndex++)
    {
        // Get the score
        Score* score = NULL;
        
        if (scoreIndex == 0)
            score = document->GetGuitarScore();
        else
            score = document->GetBassScore();
        
        wxCHECK2(score != NULL, continue);
        
        // Parse the guitars in the score
        // In Power Tab Editor v1.7, the guitar data can be accessed via the Guitar Property Sheet:
        // Menu Guitar -> Setup
        wxUint32 guitarIndex = 0;
        wxUint32 guitarCount = score->GetGuitarCount();
        for (; guitarIndex < guitarCount; guitarIndex++)
        {
            Guitar* guitar = score->GetGuitar(guitarIndex);
            wxCHECK2(guitar != NULL, continue);
    
            wxByte number = guitar->GetNumber();        
            wxString description = guitar->GetDescription();
            wxByte preset = guitar->GetPreset();
            wxByte initialVolume = guitar->GetInitialVolume();
            wxByte pan = guitar->GetPan();
            wxByte reverb = guitar->GetReverb();
            wxByte chorus = guitar->GetChorus();
            wxByte tremolo = guitar->GetTremolo();
            wxByte phaser = guitar->GetPhaser();
            wxByte capo = guitar->GetCapo();
            
            const Tuning& tuning = guitar->GetTuning();
            wxString name = tuning.GetName();
            wxInt8 musicNotationOffset = tuning.GetMusicNotationOffset();
            bool usesSharps = tuning.UsesSharps();
            
            // Get the MIDI note pitch for each string, starting with the highest string
            // Highest string = High E on standard guitar tuning
            size_t string = 0;
            size_t stringCount = tuning.GetStringCount();
            for (; string < stringCount; string++)
            {
                // MIDI note pitch (see MIDI_NOTE_xx constants in generalmidi.h)
                wxByte note = tuning.GetNote(string);
            }
        }
        
        // Parse the chord diagrams in the score
        // In Power Tab Editor v1.7, chord diagrams can be accessed via the Guitar Property Sheet:
        // Menu Guitar -> Chord Diagram List
        
        // The chord diagrams appear in the Chord Diagram List in the order they are stored in the chord diagram
        // array in the score
        wxUint32 chordDiagramIndex = 0;
        wxUint32 chordDiagramCount = score->GetChordDiagramCount();
        for (; chordDiagramIndex < chordDiagramCount; chordDiagramIndex++)
        {
            ChordDiagram* chordDiagram = score->GetChordDiagram(chordDiagramIndex);
            wxCHECK2(chordDiagram != NULL, continue);
            
            // In Power Tab Editor v1.7, chord name data can be accessed via the Chord Name dialog:
            // Menu Text -> Chord Name
            const ChordName& chordName = chordDiagram->GetChordNameConstRef();
            wxByte tonicKey = 0;
            wxByte tonicKeyVariation = 0;
            chordName.GetTonic(tonicKey, tonicKeyVariation);
            wxByte bassNoteKey = 0;
            wxByte bassNoteKeyVariation = 0;
            chordName.GetBassNote(bassNoteKey, bassNoteKeyVariation);
            
            wxByte formula = chordName.GetFormula();
            bool brackets = chordName.HasBrackets();
            bool noChord = chordName.IsNoChord();
            
            wxWord formulaModificationFlag = ChordName::extended9th;
            for (; formulaModificationFlag <= ChordName::suspended4th; formulaModificationFlag *= 2)
            {
                if (chordName.IsFormulaModificationFlagSet(formulaModificationFlag))
                {
                    
                }
                
                // Block overflow
                if (formulaModificationFlag == ChordName::suspended4th)
                    break;
            }
            
            if (chordName.IsFretPositionUsed())
            {
                wxByte fretPosition = chordName.GetFretPosition();
            }
            
            if (chordName.IsTypeUsed())
            {
                wxByte type = chordName.GetType();   
            }

            wxByte topFret = chordDiagram->GetTopFret();
            
            size_t string = 0;
            size_t stringCount = chordDiagram->GetStringCount();
            for (; string < stringCount; string++)
            {
                wxByte fretNumber = chordDiagram->GetFretNumber(string);
            }
        }
        
        // Parse the floating text items in the score
        // In Power Tab Editor v1.7, floating text items are created using:
        // Menu Text -> Insert
        
        // Floating text items are stored in the array by order of their rect.top and
        // rect.left values
        // i.e. An item at left = 40, top = 100 is stored prior to left = 10, top = 120
        wxUint32 floatingTextIndex = 0;
        wxUint32 floatingTextCount = score->GetFloatingTextCount();
        for (; floatingTextIndex < floatingTextCount; floatingTextIndex++)
        {
            FloatingText* floatingText = score->GetFloatingText(floatingTextIndex);
            wxCHECK2(floatingText != NULL, continue);
            
            wxString text = floatingText->GetText();
            wxRect rect = floatingText->GetRect();
            wxByte alignment = floatingText->GetAlignment();
            bool border = floatingText->HasBorder();
            
            // Font setting for the text
            const FontSetting& fontSetting = floatingText->GetFontSettingConstRef();
            wxString faceName = fontSetting.GetFaceName();
            wxInt32 pointSize = fontSetting.GetPointSize();
            wxInt32 weight = fontSetting.GetWeight();
            bool italic = fontSetting.IsItalic();
            bool underline = fontSetting.IsUnderline();
            bool strikeOut = fontSetting.IsStrikeOut();
            wxColor color = fontSetting.GetColor();
        }
        
        // Parse the guitar ins in the score
        // In Power Tab Editor v1.7, guitar ins can be accessed via the Guitar In dialog:
        // Menu Guitar -> Guitar In
        
        // Guitar Ins are stored in the array by order of their system, position and 
        // staff values
        wxUint32 guitarInIndex = 0;
        wxUint32 guitarInCount = score->GetGuitarInCount();
        for (; guitarInIndex < guitarInCount; guitarInIndex++)
        {
            GuitarIn* guitarIn = score->GetGuitarIn(guitarInIndex);
            wxCHECK2(guitarIn != NULL, continue);
            
            wxWord system = guitarIn->GetSystem();
            wxByte staff = guitarIn->GetStaff();
            wxByte position = guitarIn->GetPosition();
            
            if (guitarIn->HasStaffGuitarsSet())
            {
                wxByte staffGuitars = guitarIn->GetStaffGuitars();
            }
            
            if (guitarIn->HasRhythmSlashGuitarsSet())
            {
                wxByte rhythmSlashGuitars = guitarIn->GetRhythmSlashGuitars();
            }
        }
        
        // Parse the tempo markers in the score
        // In Power Tab Editor v1.7, tempo markers can be accessed via the Tempo Marker dialog:
        // Menu Music Symbols -> Tempo Marker
        // and the Alteration of Pace dialog:
        // Menu Music Symbols -> Alteration of Pace
        
        // Tempo Markers are stored in the array by order of their system, position and 
        // staff values
        wxUint32 tempoMarkerIndex = 0;
        wxUint32 tempoMarkerCount = score->GetTempoMarkerCount();
        for (; tempoMarkerIndex < tempoMarkerCount; tempoMarkerIndex++)
        {
            TempoMarker* tempoMarker = score->GetTempoMarker(tempoMarkerIndex);
            wxCHECK2(tempoMarker != NULL, continue);
            
            if (tempoMarker->IsStandardMarker())
            {
                wxByte beatType = tempoMarker->GetBeatType();
                wxUint32 beatsPerMinute = tempoMarker->GetBeatsPerMinute();
            }
            else if (tempoMarker->IsListesso())
            {
                wxByte beatType = tempoMarker->GetBeatType();
                wxByte listessoBeatType = tempoMarker->GetBeatType();
            }
            else if (tempoMarker->IsAlterationOfPace())
            {
                if (tempoMarker->IsAccelerando())
                {
                }
                else if (tempoMarker->IsRitardando())
                {
                }
            }
            
            if (tempoMarker->HasTripletFeel())
            {
                wxByte tripletFeelType = tempoMarker->GetTripletFeelType();
            }
            
            wxString description = tempoMarker->GetDescription();            
        }
        
        // Parse the dynamics in the score
        // In Power Tab Editor v1.7, dynamics can be accessed via the Dynamic dialog:
        // Menu Music Symbols -> Dynamic
        
        // Dynamics are stored in the array by order of their system, position and
        // staff values
        wxUint32 dynamicIndex = 0;
        wxUint32 dynamicCount = score->GetDynamicCount();
        for (; dynamicIndex < dynamicCount; dynamicIndex++)
        {
            Dynamic* dynamic = score->GetDynamic(dynamicIndex);
            wxCHECK2(dynamic != NULL, continue);
            
            wxWord system = dynamic->GetSystem();
            wxByte staff = dynamic->GetStaff();
            wxByte position = dynamic->GetPosition();
            
            // Staff volume is set
            if (dynamic->IsStaffVolumeSet())
            {
                wxByte staffVolume = dynamic->GetStaffVolume();
            }
            
            // Rhythm slash volume is set
            if (dynamic->IsRhythmSlashVolumeSet())
            {
                wxByte rhythmSlashVolume = dynamic->GetRhythmSlashVolume();
            }
        }
        
        // Parse the alternate endings in the score
        // In Power Tab Editor v1.7, alternate endings can be accessed via the Repeat Ending dialog:
        // Menu Music Symbols -> Repeat Ending
        
        // Alternate endings are stored in the array by order of their system and
        // position values
        wxUint32 alternateEndingIndex = 0;
        wxUint32 alternateEndingCount = score->GetAlternateEndingCount();
        for (; alternateEndingIndex < alternateEndingCount; alternateEndingIndex++)
        {
            AlternateEnding* alternateEnding = score->GetAlternateEnding(alternateEndingIndex);
            wxCHECK2(alternateEnding != NULL, continue);
            
            wxWord system = alternateEnding->GetSystem();
            wxByte position = alternateEnding->GetPosition();
            
            // Determine which numbers are set
            wxWord number = 1;            
            for (; number <= AlternateEnding::dalSegnoSegno; number++)
            {
                if (alternateEnding->IsNumberSet(number))
                {
                    // Number is set
                }
            }
        }
        
        // Parse the systems in the score
        // In Power Tab Editor v1.7, systems can be accessed via the Section menu:
        // Menu Section -> New Section
        
        // Systems are stored in the array by order they are drawn in the score
        wxUint32 systemIndex = 0;
        wxUint32 systemCount = score->GetSystemCount();
        for (; systemIndex < systemCount; systemIndex++)
        {
            System* system = score->GetSystem(systemIndex);
            wxCHECK2(system != NULL, continue);
    
            wxRect rect = system->GetRect();
            wxByte positionSpacing = system->GetPositionSpacing();

            // Parse the directions in the system
            // In Power Tab Editor v1.7, directions can be accessed via the Musical Direction dialog:
            // Menu Music Symbols -> Musical Direction
            wxUint32 directionIndex = 0;
            wxUint32 directionCount = system->GetDirectionCount();
            for (; directionIndex < directionCount; directionIndex++)
            {
                Direction* direction = system->GetDirection(directionIndex);
                wxCHECK2(direction != NULL, continue);
                
                wxUint32 position = direction->GetPosition();
                
                // There may be up to 3 symbols per object
                size_t symbolIndex = 0;
                size_t symbolCount = direction->GetSymbolCount();
                for (; symbolIndex < symbolCount; symbolIndex++)
                {
                    wxByte symbolType = 0;
                    wxByte activeSymbol = 0;
                    wxByte repeatNumber = 0;
                    direction->GetSymbol(symbolIndex, symbolType, activeSymbol, repeatNumber);
                }
            }
            
            // Parse the chord text items in the system
            // In Power Tab Editor v1.7, chord text/chord name data can be accessed via the Chord Name dialog:
            // Menu Text -> Chord Name
            wxUint32 chordTextIndex = 0;
            wxUint32 chordTextCount = system->GetChordTextCount();
            for (; chordTextIndex < chordTextCount; chordTextIndex++)
            {
                ChordText* chordText = system->GetChordText(chordTextIndex);
                wxCHECK2(chordText != NULL, continue);
                
                wxUint32 positon = chordText->GetPosition();
                
                const ChordName& chordName = chordText->GetChordNameConstRef();
                wxByte tonicKey = 0;
                wxByte tonicKeyVariation = 0;
                chordName.GetTonic(tonicKey, tonicKeyVariation);
                wxByte bassNoteKey = 0;
                wxByte bassNoteKeyVariation = 0;
                chordName.GetBassNote(bassNoteKey, bassNoteKeyVariation);
                
                wxByte formula = chordName.GetFormula();
                bool brackets = chordName.HasBrackets();
                bool noChord = chordName.IsNoChord();
                
                wxWord formulaModificationFlag = ChordName::extended9th;
                for (; formulaModificationFlag <= ChordName::suspended4th; formulaModificationFlag *= 2)
                {
                    if (chordName.IsFormulaModificationFlagSet(formulaModificationFlag))
                    {
                        
                    }
                    
                    // Block overflow
                    if (formulaModificationFlag == ChordName::suspended4th)
                        break;
                }
                
                if (chordName.IsFretPositionUsed())
                {
                    wxByte fretPosition = chordName.GetFretPosition();
                }
                
                if (chordName.IsTypeUsed())
                {
                    wxByte type = chordName.GetType();   
                }
            }

            // Parse the rhythm slashes in the system
            // In Power Tab Editor v1.7, rhythm slash data can be accessed via the Rhy. Slashes menu
            wxUint32 rhythmSlashIndex = 0;
            wxUint32 rhythmSlashCount = system->GetRhythmSlashCount();
            for (; rhythmSlashIndex < rhythmSlashCount; rhythmSlashIndex++)
            {
                RhythmSlash* rhythmSlash = system->GetRhythmSlash(rhythmSlashIndex);
                wxCHECK2(rhythmSlash != NULL, continue);
                
                wxUint32 position = rhythmSlash->GetPosition();
                wxByte durationType = rhythmSlash->GetDurationType();
                wxByte previousDurationType = rhythmSlash->GetPreviousBeamDurationType();
                
                bool beamStart = rhythmSlash->IsBeamStart();
                bool fractionalBeam = rhythmSlash->HasFractionalBeam();
                bool beamEnd = rhythmSlash->IsBeamEnd();
                
                bool tripletStart = rhythmSlash->IsTripletStart();
                bool tripletMiddle = rhythmSlash->IsTripletMiddle();
                bool tripletEnd = rhythmSlash->IsTripletEnd();
                
                bool dotted = rhythmSlash->IsDotted();
                bool doubleDotted = rhythmSlash->IsDoubleDotted();
                bool rest = rhythmSlash->IsRest();
                bool tied = rhythmSlash->IsTied();
                bool muted = rhythmSlash->IsMuted();
                bool staccato = rhythmSlash->IsStaccato();
                bool pickstrokeUp = rhythmSlash->HasPickStrokeUp();
                bool pickstrokeDown = rhythmSlash->HasPickStrokeDown();
                bool arpeggioUp = rhythmSlash->HasArpeggioUp();
                bool arpeggioDown = rhythmSlash->HasArpeggioDown();
                bool tripletFeel1st = rhythmSlash->IsTripletFeel1st();
                bool tripletFeel2nd = rhythmSlash->IsTripletFeel2nd();
                bool marcato = rhythmSlash->HasMarcato();
                bool sforzando = rhythmSlash->HasSforzando();
                bool slideIntoFromAbove = rhythmSlash->HasSlideIntoFromAbove();
                bool slideIntoFromBelow = rhythmSlash->HasSlideIntoFromBelow();
                bool slideOutOfDownwards = rhythmSlash->HasSlideOutOfDownwards();
                bool slideOutOfUpwards = rhythmSlash->HasSlideOutOfUpwards();
                
                // TODO: If has single note
                {
                    wxByte stringNumber = 0;
                    wxByte fretNumber = 0;
                    rhythmSlash->GetSingleNoteData(stringNumber, fretNumber);
                }
            }
            
            // Parse the barline at the start of the system
            {
                const Barline& startBar = system->GetStartBarConstRef();
                wxByte type = startBar.GetType();
                if (startBar.IsRepeatEnd())
                {
                    wxUint32 repeatCount = startBar.GetRepeatCount();
                }
                const KeySignature& keySignature = startBar.GetKeySignatureConstRef();
                wxByte keyType = 0;
                wxByte keyAccidentals = 0;
                keySignature.GetKey(keyType, keyAccidentals);
                if (keySignature.IsShown())
                {
                }
                if (keySignature.IsCancellation())
                {
                }
                
                const TimeSignature& timeSignature = startBar.GetTimeSignatureConstRef();
                wxByte beatsPerMeasure = 0;
                wxByte beatAmount = 0;
                timeSignature.GetMeter(beatsPerMeasure, beatAmount);
                if (timeSignature.IsCutTime())
                {
                }
                if (timeSignature.IsCommonTime())
                {
                }
                
                wxByte beat1 = 0;
                wxByte beat2 = 0;
                wxByte beat3 = 0;
                wxByte beat4 = 0;
                timeSignature.GetBeamingPattern(beat1, beat2, beat3, beat4);
                if (timeSignature.IsShown())
                {
                }
                wxByte pulses = timeSignature.GetPulses();
                
                const RehearsalSign& rehearsalSign = startBar.GetRehearsalSignConstRef();
                if (rehearsalSign.IsSet())
                {
                    wxInt8 letter = rehearsalSign.GetLetter();
                    wxString description = rehearsalSign.GetDescription();
                }
            }
            
            // Parse the barlines within the system
            wxUint32 barlineIndex = 0;
            wxUint32 barlineCount = system->GetBarlineCount();
            for (; barlineIndex < barlineCount; barlineIndex++)
            {
                Barline* barline = system->GetBarline(barlineIndex);
                wxCHECK2(barline != NULL, continue);
                
                wxUint32 position = barline->GetPosition();
                
                const KeySignature& keySignature = barline->GetKeySignatureConstRef();
                wxByte keyType = 0;
                wxByte keyAccidentals = 0;
                keySignature.GetKey(keyType, keyAccidentals);
                if (keySignature.IsShown())
                {
                }
                if (keySignature.IsCancellation())
                {
                }
                
                const TimeSignature& timeSignature = barline->GetTimeSignatureConstRef();
                wxByte beatsPerMeasure = 0;
                wxByte beatAmount = 0;
                timeSignature.GetMeter(beatsPerMeasure, beatAmount);
                if (timeSignature.IsCutTime())
                {
                }
                if (timeSignature.IsCommonTime())
                {
                }
                
                wxByte beat1 = 0;
                wxByte beat2 = 0;
                wxByte beat3 = 0;
                wxByte beat4 = 0;
                timeSignature.GetBeamingPattern(beat1, beat2, beat3, beat4);
                if (timeSignature.IsShown())
                {
                }
                wxByte pulses = timeSignature.GetPulses();
                
                const RehearsalSign& rehearsalSign = barline->GetRehearsalSignConstRef();
                if (rehearsalSign.IsSet())
                {
                    wxInt8 letter = rehearsalSign.GetLetter();
                    wxString description = rehearsalSign.GetDescription();
                }
            }
            
            // Parse the barline at the end of the system
            {
                const Barline& endBar = system->GetEndBarConstRef();
                wxByte type = endBar.GetType();
                if (endBar.IsRepeatEnd())
                {
                    wxUint32 repeatCount = endBar.GetRepeatCount();
                }
                const KeySignature& keySignature = endBar.GetKeySignatureConstRef();
                wxByte keyType = 0;
                wxByte keyAccidentals = 0;
                keySignature.GetKey(keyType, keyAccidentals);
                if (keySignature.IsShown())
                {
                }
                if (keySignature.IsCancellation())
                {
                }
                
                const TimeSignature& timeSignature = endBar.GetTimeSignatureConstRef();
                wxByte beatsPerMeasure = 0;
                wxByte beatAmount = 0;
                timeSignature.GetMeter(beatsPerMeasure, beatAmount);
                if (timeSignature.IsCutTime())
                {
                }
                if (timeSignature.IsCommonTime())
                {
                }
                
                wxByte beat1 = 0;
                wxByte beat2 = 0;
                wxByte beat3 = 0;
                wxByte beat4 = 0;
                timeSignature.GetBeamingPattern(beat1, beat2, beat3, beat4);
                if (timeSignature.IsShown())
                {
                }
                wxByte pulses = timeSignature.GetPulses();
                
                const RehearsalSign& rehearsalSign = endBar.GetRehearsalSignConstRef();
                if (rehearsalSign.IsSet())
                {
                    wxInt8 letter = rehearsalSign.GetLetter();
                    wxString description = rehearsalSign.GetDescription();
                }
            }
            
            // Parse the staves in the system
            // In Power Tab Editor v1.7, staves can be accessed via the Section menu:
            // Menu Section -> Attach Staff
            // and by clicking the clef on the standard notation standard staff and
            // by clicking the "TAB" clef on the tablature staff
            wxUint32 staffIndex = 0;
            wxUint32 staffCount = system->GetStaffCount();
            for (; staffIndex < staffCount; staffIndex++)
            {
                Staff* staff = system->GetStaff(staffIndex);
                wxCHECK2(staff != NULL, continue);
                
                wxByte clef = staff->GetClef();
                wxByte tablatureStaffType = staff->GetTablatureStaffType();
                
                // Parse the positions in each voice
                wxUint32 voice = 0;
                for (; voice < NUM_STAFF_VOICES; voice++)
                {
                    wxUint32 positionIndex = 0;
                    wxUint32 positionCount = staff->GetPositionCount(voice);
                    for (; positionIndex < positionCount; positionIndex++)
                    {
                        Position* position = staff->GetPosition(voice, positionIndex);
                        wxCHECK2(position != NULL, continue);
                    
                        wxUint32 positionIndex = 0;
                        wxUint32 positionCount = staff->GetPositionCount(voice);
                        for (; positionIndex < positionCount; positionIndex++)
                        {
                            Position* position = staff->GetPosition(voice, positionIndex);
                            wxCHECK2(position != NULL, continue);
                            
                            wxUint32 position2 = position->GetPosition();
                            wxByte durationType = position->GetDurationType();
                            if (position->HasIrregularGroupingTiming())
                            {
                                wxByte notesPlayed = 0;
                                wxByte notesPlayedOver = 0;
                                position->GetIrregularGroupingTiming(notesPlayed, notesPlayedOver);
                            }
                            wxByte previousBeamDurationType = position->GetPreviousBeamDurationType();
                            bool beamStart = position->IsBeamStart();
                            bool fractionalLeftBeam = position->HasFractionalLeftBeam();
                            bool fractionalRightBeam = position->HasFractionalRightBeam();
                            bool beamEnd = position->IsBeamEnd();
                            
                            bool dotted = position->IsDotted();
                            bool doubleDotted = position->IsDoubleDotted();
                            bool rest = position->IsRest();
                            bool vibrato = position->HasVibrato();
                            bool wideVibrato = position->HasWideVibrato();
                            bool arpeggioUp = position->HasArpeggioUp();
                            bool arpeggioDown = position->HasArpeggioDown();
                            bool pickstrokeUp = position->HasPickStrokeUp();
                            bool pickstrokeDown = position->HasPickStrokeDown();
                            bool staccato = position->IsStaccato();
                            bool marcato = position->HasMarcato();
                            bool sforzando = position->HasSforzando();
                            bool tremoloPicking = position->HasTremoloPicking();
                            bool palmMuting = position->HasPalmMuting();
                            bool tap = position->HasTap();
                            bool acciaccatura = position->IsAcciaccatura();
                            bool tripletFeel1st = position->IsTripletFeel1st();
                            bool tripletFeel2nd = position->IsTripletFeel2nd();
                            bool letRing = position->HasLetRing();
                            bool fermata = position->HasFermata();
                            bool irregularGroupingStart = position->IsIrregularGroupingStart();
                            bool irregularGroupingMiddle = position->IsIrregularGroupingMiddle();
                            bool irregularGroupingEnd = position->IsIrregularGroupingEnd();
                            
                            if (position->HasVolumeSwell())
                            {
                                wxByte startVolume = 0;
                                wxByte endVolume = 0;
                                wxByte duration = 0;
                                position->GetVolumeSwell(startVolume, endVolume, duration);
                            }
                            
                            if (position->HasTremoloBar())
                            {
                                wxByte type = 0;
                                wxByte duration = 0;
                                wxByte pitch = 0;
                                position->GetTremoloBar(type, duration, pitch);
                            }
                            
                            // Parse the notes
                            // In Power Tab Editor v1.7, note data can be accessed via the Notes menu, as well as
                            // the Tab Symbols menu
                            wxUint32 noteIndex = 0;
                            wxUint32 noteCount = position->GetNoteCount();
                            for (; noteIndex < noteCount; noteIndex++)
                            {
                                Note* note = position->GetNote(noteIndex);
                                wxCHECK2(note != NULL, continue);
                                
                                wxUint32 string = note->GetString();
                                wxUint32 fretNumber = note->GetFretNumber();
                                bool tied = note->IsTied();
                                bool muted = note->IsMuted();
                                bool tieWrap = note->HasTieWrap();
                                bool hammerOn = note->HasHammerOn();
                                bool hammerOnFromNowhere = note->HasHammerOnFromNowhere();
                                bool pullOff = note->HasPullOff();
                                bool pullOffToNowhere = note->HasPullOffToNowhere();
                                bool naturalHarmonic = note->IsNaturalHarmonic();
                                bool ghostNote = note->IsGhostNote();
                                bool octave8va = note->IsOctave8va();
                                bool octave15ma = note->IsOctave15ma();
                                bool octave8vb = note->IsOctave8vb();
                                bool octave15mb = note->IsOctave15mb();
                                
                                if (note->HasSlideInto())
                                {
                                    wxByte type = 0;
                                    note->GetSlideInto(type);
                                }
                                
                                if (note->HasSlideOutOf())
                                {
                                    wxByte type = 0;
                                    wxInt8 steps = 0;
                                    note->GetSlideOutOf(type, steps);
                                }
                                
                                if (note->HasBend())
                                {
                                    wxByte type = 0;
                                    wxByte bentPitch = 0;
                                    wxByte releasePitch = 0;
                                    wxByte duration = 0;
                                    wxByte drawStartPoint = 0;
                                    wxByte drawEndPoint = 0;
                                    note->GetBend(type, bentPitch, releasePitch, duration, drawStartPoint, drawEndPoint);
                                }
                                
                                if (note->HasTappedHarmonic())
                                {
                                    wxByte tappedFretNumber = 0;
                                    note->GetTappedHarmonic(tappedFretNumber);
                                }
                                
                                if (note->HasTrill())
                                {
                                    wxByte trilledFretNumber = 0;
                                    note->GetTrill(trilledFretNumber);
                                }
                                
                                if (note->HasArtificialHarmonic())
                                {
                                    wxByte key = 0;
                                    wxByte keyVariation = 0;
                                    wxByte octave = 0;
                                    note->GetArtificialHarmonic(key, keyVariation, octave);
                                }
                            }
                        }
                    }
                }
            }
        }
    }   
    
    // In Power Tab Editor v1.7, font settings can be accessed via the Song Property Sheet:
    // Menu View -> Fonts
    {
        const FontSetting& chordNameFontSetting = document->GetChordNameFontSettingConstRef();
        wxString faceName = chordNameFontSetting.GetFaceName();
        wxInt32 pointSize = chordNameFontSetting.GetPointSize();
        wxInt32 weight = chordNameFontSetting.GetWeight();
        bool italic = chordNameFontSetting.IsItalic();
        bool underline = chordNameFontSetting.IsUnderline();
        bool strikeOut = chordNameFontSetting.IsStrikeOut();
        wxColor color = chordNameFontSetting.GetColor();
    }
    
    {            
        const FontSetting& tablatureNumbersFontSetting = document->GetTablatureNumbersFontSettingConstRef();
        wxString faceName = tablatureNumbersFontSetting.GetFaceName();
        wxInt32 pointSize = tablatureNumbersFontSetting.GetPointSize();
        wxInt32 weight = tablatureNumbersFontSetting.GetWeight();
        bool italic = tablatureNumbersFontSetting.IsItalic();
        bool underline = tablatureNumbersFontSetting.IsUnderline();
        bool strikeOut = tablatureNumbersFontSetting.IsStrikeOut();
        wxColor color = tablatureNumbersFontSetting.GetColor();
    }
    
    // In Power Tab Editor v1.7, tablature line spacing values can be accessed via the Line Height submenu
    // on the Section menu
    wxUint32 tablatureStaffLineSpacing = document->GetTablatureStaffLineSpacing();
    
    // In Power Tab Editor v1.7, fade values can be accessed via the Fade dialog:
    // Menu Music Symbols -> Fade
    wxUint32 fadeIn = document->GetFadeIn();
    wxUint32 fadeOut = document->GetFadeOut();
    
    wxLongLong totalTime = ::wxGetLocalTimeMillis() - startTime;
    double milliseconds = ((double)totalTime.ToLong()) / 1000.0;
        
    wxMessageBox(wxString::Format(wxT("File parsed in %.3f seconds."), milliseconds), wxTheApp->GetAppName(), wxICON_INFORMATION);
}
Beispiel #10
0
void ReportSagittal::OnUpdate(CView* aSenderPtr,LPARAM aHint,CObject* aHintPtr)
{
    C_Hom_Doc *lDocPtr = (C_Hom_Doc*)GetDocument();
    //Analysis &lResults = lDocPtr->getResultsRef();

    // Fill in measurement units text
//    Force temp(0.0F,0);
    mCompressionLabel = CString("") + "Total Compression (" + lDocPtr->ForceUnits() + "):";
    mShearLabel = CString("") + "Total Shear (" + lDocPtr->ForceUnits() + "):";

    // Get sagittal low back analysis results
    //LowBackSagittalData sagittal;
    //lResults.getLowBackSagittal(&sagittal);
	const LowBackSagittalData_s& sagittal = lDocPtr->GetSkeleton()->getLowBackSagittalData();

    // Write results to the form controls, converting to the desired system of units in the process
	const int NUM_DATUM = 12;
    CString* reported[] = {&mTotalCompression,&mTotalCompressionSD,&mErectorSpinae,&mErectorSpinaeSD,&mRectusAbdominus,
                           &mRectusAbdominusSD,&mAbdominal,&mCompressionHandLoads,&mCompressionBodyWeight,&mTotalShear,
                           &mSagittal,&mFrontal};
	double data[] = {sagittal.cmpTotal, sagittal.cmpTotalSD, sagittal.cmpSpinae, sagittal.cmpSpinaeSD, sagittal.cmpAbdominus,
					sagittal.cmpAbdominusSD, sagittal.cmpAbdominal, sagittal.cmpHandLoads, sagittal.cmpUpperBody, sagittal.shrTotal,
					sagittal.shrSagittal, sagittal.shrFrontal};
    for(int i = 0; i < NUM_DATUM; ++i)
    {
		(*(reported[i])).Format("%.0f", data[i]);
        //temp.Value(*((double*)&sagittal + i), MetricCns); // + 2 to pass by total compression / stddev
		//temp.Value(data[i], MetricCns);
        //*(reported[i]) = temp.ValueText();
    }
    mStrain.Format("%.0f",sagittal.ligamentStrain);

    // Add +/- to the standard deviations
    mTotalCompressionSD = "+/- " + mTotalCompressionSD;
    mErectorSpinaeSD = "+/- " + mErectorSpinaeSD;
    mRectusAbdominusSD = "+/- " + mRectusAbdominusSD;

	mHeader = lDocPtr->ReportHeader();
    mFooter = lDocPtr->ReportFooter();
       
    UpdateData( FALSE );

	UpdateUnits();

	Skeleton &lSkeleton = *lDocPtr->GetSkeleton();

	mHandForceTxtLVal.Format("%.1f", lSkeleton.getExtForce(JT_LHAND).length());
	mHandForceTxtRVal.Format("%.1f", lSkeleton.getExtForce(JT_RHAND).length());

	Vector3 offsetCoordinate = lDocPtr->getOffset();

	Vector3 LHand = lSkeleton.getJoint(JT_LHAND);

    mLeftHori.Format("%.1f", (LHand[1] -  offsetCoordinate[1]));
	mLeftLat.Format("%.1f", (LHand[0] - offsetCoordinate[0]));
	mLeftVert.Format("%.1f", (LHand[2] - offsetCoordinate[2]));


	Vector3 RHand = lSkeleton.getJoint(JT_RHAND);

	mRightHori.Format("%.1f", (RHand[1]  - offsetCoordinate[1]));
	mRightLat.Format("%.1f", (RHand[0] - offsetCoordinate[0]));
	mRightVert.Format("%.1f", (RHand[2] - offsetCoordinate[2]));
}
Beispiel #11
0
void CMatchView1::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CvSize dstsize;
	IplImage* tempimg;
	CString outmsg;
	pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd;//得到主窗口指针
	CMatchDoc* pDoc=GetDocument();
	if(pDoc->isenlarge)
	{
		if(pDoc->scale1-2.8<1e-6)
		{
			pDoc->scale1+=0.2;
			//使Scrollbar符合图像大小
			if(pDoc->IMG1OPEN)
				SetScrollSizes(MM_TEXT,CSize(pDoc->m_imgsize2.width*pDoc->scale1,pDoc->m_imgsize2.height*pDoc->scale1));
			
			//保证每次创建的显示图像内存大小与待打开图像大小一致
			m_frame2.Create(pDoc->m_imgsize2.width*pDoc->scale1,pDoc->m_imgsize2.height*pDoc->scale1,24);
			
			//填充显示图像内存区域
			if(pDoc->IMG1OPEN)
			{
				ShownImage2=m_frame2.GetImage();
				//	cvSetImageROI(ShownImage1,cvRect(0,0,pDoc->m_imgsize1.width*pDoc->scale,pDoc->m_imgsize1.height*pDoc->scale));
				dstsize.width=pDoc->m_imgsize2.width*pDoc->scale1;
				dstsize.height=pDoc->m_imgsize2.height*pDoc->scale1;
				tempimg=cvCreateImage(dstsize,pDoc->srcImg2->depth,pDoc->srcImg2->nChannels);
				cvResize(pDoc->showImg2,tempimg,0);
				cvCopy(tempimg,ShownImage2);
				outmsg.Format(">>图像2大小增大至%d*%d",tempimg->width,tempimg->height);	
			}
			else
				outmsg=">>没有打开图像2,不能增大";
		}
		else
			outmsg=">>图像2不能继续增大";
		pFrame->m_listbox.SetTextColor(pDoc->crTextColor1);
		pFrame->m_listbox.InsertItem(0,outmsg);
	}
	else if(pDoc->isreduce)
	{
		if(pDoc->scale1-0.2>1e-6)
		{
			pDoc->scale1-=0.2;
			//使Scrollbar符合图像大小
			if(pDoc->IMG1OPEN)
				SetScrollSizes(MM_TEXT,CSize(pDoc->m_imgsize2.width*pDoc->scale1,pDoc->m_imgsize2.height*pDoc->scale1));
			
			//保证每次创建的显示图像内存大小与待打开图像大小一致
			m_frame2.Create(pDoc->m_imgsize2.width*pDoc->scale1,pDoc->m_imgsize2.height*pDoc->scale1,24);
			
			//填充显示图像内存区域
			if(pDoc->IMG1OPEN)
			{
				ShownImage2=m_frame2.GetImage();
				//	cvSetImageROI(ShownImage1,cvRect(0,0,pDoc->m_imgsize1.width*pDoc->scale,pDoc->m_imgsize1.height*pDoc->scale));
				dstsize.width=pDoc->m_imgsize2.width*pDoc->scale1;
				dstsize.height=pDoc->m_imgsize2.height*pDoc->scale1;
				tempimg=cvCreateImage(dstsize,pDoc->srcImg2->depth,pDoc->srcImg2->nChannels);
				cvResize(pDoc->showImg2,tempimg,0);
				cvCopy(tempimg,ShownImage2);
				outmsg.Format(">>图像2大小减小至%d*%d",tempimg->width,tempimg->height);	
			}
			else
				outmsg=">>没有打开图像2,不能减小";
		}
		else
			outmsg=">>图像2不能继续减小";
		pFrame->m_listbox.SetTextColor(pDoc->crTextColor1);
		pFrame->m_listbox.InsertItem(0,outmsg);
	}
	if(pDoc->isdeletefeas1)
	{
		int nIn; //定义一个鼠标的点击值;
		nIn=GetDocument()->m_rectTracker1.HitTest(point); //看看点到了哪了
		if(nIn<0)  //不在四边形区域内;
		{
		}
		else 
			//在四边形区域内:
		{
			// Track()是CRectTracker中最富魅力的函数。它时时的改变调用者的m_rect;
			GetDocument()->m_rectTracker1.Track(this,point,TRUE);
			CClientDC dc(this);
			pDoc->m_rect2=pDoc->m_rectTracker1.m_rect;
			OnPrepareDC(&dc);
			dc.DPtoLP(&pDoc->m_rect2);
			//GetDocument()->m_rectTracker.Draw(&dc);
			bDraw=TRUE;
		}
	}
	Invalidate(true);
	CScrollView::OnLButtonDown(nFlags, point);
}
Beispiel #12
0
void CSysCADMarshalView::OnDraw(CDC* pDC)
{
  CSysCADMarshalDoc* pDoc = GetDocument();
  ASSERT_VALID(pDoc);
  // TODO: add draw code for native data here
}
Beispiel #13
0
void CAutoExeView::OnDraw(CDC* pDC)
{
	CAutoExeDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}
Beispiel #14
0
/// Add a custom property: update event
void ctConfigToolView::OnUpdateAddCustomProperty(wxUpdateUIEvent& event)
{
    ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
    event.Enable( doc && GetSelection() && GetSelection()->GetParent() );
}
Beispiel #15
0
/**
	@brief	call back function
	@author	HumKyung
	@date	2011.01.05
	@param
	@return
*/
void CBusToBusView::OnBnClickedSave()
{
	CELoadDocData& docData = CELoadDocData::GetInstance();
	const STRING_T sProjectMDBFilePath = docData.GetProjectMDBFilePath();
	/// MDB CONNECT
	CADODB adoDB;
	const STRING_T sDBPath = STRING_T(PROVIDER) + _T("Data Source=") + sProjectMDBFilePath  + DB_PASSWORD;
	if(TRUE == adoDB.DBConnect(sDBPath))
	{
		list<CELoadItem*> TrItemList;
		docData.GetELoadItemListOf(TrItemList , CTransformerItem::TypeString());

		const int iRowCount = m_wndGridCtrl.GetRowCount();
		for(int i = 1;i < iRowCount;++i)
		{
			CString sFromBus = m_wndGridCtrl.GetItemText(i , 1);
			CString sToBus   = m_wndGridCtrl.GetItemText(i , 2);
			if(sFromBus.IsEmpty() || sToBus.IsEmpty()) continue;

			CBusItem* pFromBus = (CBusItem*)(docData.FindItemByName(CBusItem::TypeString() , sFromBus.operator LPCSTR()));
			CBusItem* pToBus = (CBusItem*)(docData.FindItemByName(CBusItem::TypeString() , sToBus.operator LPCSTR()));

			CTransformerItem* pTrItem = (CTransformerItem*)(m_wndGridCtrl.GetItemData(i , 0));
			if(pTrItem)
			{
				pTrItem->prop()->SetValue(_T("From") , _T("Bus Id") , sFromBus.operator LPCSTR());
				pTrItem->prop()->SetValue(_T("To") , _T("Bus Id") , sToBus.operator LPCSTR());

				/// remove transformer item from list
				list<CELoadItem*>::iterator where = find(TrItemList.begin() , TrItemList.end() , pTrItem);
				if(where != TrItemList.end()) TrItemList.erase(where);
			}
			else
			{
				/// create a tranformer and insert a transformer record.
				pTrItem = static_cast<CTransformerItem*>(docData.CreateELoadItemOf(CTransformerItem::TypeString()));
				if(pTrItem)
				{
					const string sName(string(_T("DEL ")) + sFromBus.operator LPCSTR() + string(_T("_")) + sToBus.operator LPCSTR());
					pTrItem->SetName(sName);
					pTrItem->prop()->SetValue(_T("From") , _T("Bus Id") , sFromBus.operator LPCSTR());
					pTrItem->prop()->SetValue(_T("To") , _T("Bus Id") , sToBus.operator LPCSTR());

					CELoadItem* pFrom = docData.FindItemByName(CBusItem::TypeString() , sFromBus.operator LPCSTR());
					if(pFrom)
					{
						string sValue = pFrom->prop()->GetValue(_T("General") , _T("Bus Voltage"));
						pTrItem->prop()->SetValue(_T("From") , _T("Bus Volt") , sValue);
						sValue = pFrom->prop()->GetValue(_T("General") , _T("Load Voltage"));
						pTrItem->prop()->SetValue(_T("From") , _T("Load Volt") , sValue);
					}
					CELoadItem* pTo = docData.FindItemByName(CBusItem::TypeString() , sToBus.operator LPCSTR());
					if(pTo)
					{
						string sValue = pFrom->prop()->GetValue(_T("General") , _T("Bus Voltage"));
						pTrItem->prop()->SetValue(_T("To") , _T("Bus Volt") , sValue);
						sValue = pFrom->prop()->GetValue(_T("General") , _T("Load Voltage"));
						pTrItem->prop()->SetValue(_T("To") , _T("Load Volt") , sValue);
					}

					const double dCapacity = pTrItem->CalculateCapacity();
					stringstream oss;
					oss << dCapacity;
					pTrItem->prop()->SetValue(_T("Capacity") , _T("Calculated Capacity") , oss.str());
					pTrItem->prop()->SetValue(_T("Capacity") , _T("Selected Capacity") , _T("0"));

					m_wndGridCtrl.SetItemData(i , 0 , LPARAM(pTrItem));
				}
			}
			if(pTrItem) pTrItem->SaveData(adoDB , CTransformerItem::TableName());
		}

		/// delete database record which's item is deleted
		for(list<CELoadItem*>::iterator itr = TrItemList.begin();itr != TrItemList.end();++itr)
		{
			CTransformerItem* pTrItem = (CTransformerItem*)(*itr);
			if(0 != pTrItem->GetName().find(_T("DEL "))) continue;

			/// delete transformer record from table
			const string sSql = _T("DELETE * FROM ") + CTransformerItem::TableName() + _T(" WHERE C_ID='") + string(pTrItem->id()) + _T("'");
			adoDB.ExecuteQuery(sSql.c_str());

			pTrItem->SetDeleteFlag(true);
		}

		adoDB.DBDisConnect();
		GetDocument()->SetModifiedFlag(FALSE);	/// 2014.04.04 added by humkyung
	}

	CELOADApp* pApp = (CELOADApp*)AfxGetApp();
	if(pApp) pApp->OpenNewDocumentIfNeed(CBusItem::TypeString());

	AfxMessageBox(_T("Save is done."));
}
Beispiel #16
0
void CTextView::OnDraw(CDC*)
{
	CTextDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
}
void CGoIO_consoleView::OnDraw(CDC* pDC)
{
	CGoIO_consoleDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}
Beispiel #18
0
void DrawingView::OnCut(wxCommandEvent& WXUNUSED(event) )
{
    DrawingDocument * const doc = GetDocument();

    doc->GetCommandProcessor()->Submit(new DrawingRemoveSegmentCommand(doc));
}
Beispiel #19
0
void
MFCArrangeView::OnDraw(CDC* pdc)
{
	CRect	clipBox;
	int		cbType;
	cbType = pdc->GetClipBox(&clipBox);
	CDocument* pDoc = GetDocument();
	// COMPLEXREGION 3
	// SIMPLEREGION 2
	// NULLREGION 1
	// ERROR 0

#ifdef QUA_V_GDI_PLUS
	CMemDC memdc(pdc);
	Graphics graphics(memdc);
	CPoint sp = GetScrollPosition();

//  graphics.TranslateTransform(-sp.x, -sp.y);
//	SetWindowOrgEx(pdc->m_hDC, ps.x, ps.y, NULL);
//	std::cerr << "MFCArrangeView OnDraw " << " clip box " << cbType << ", scroll " << sp.x << ", " << sp.y << "; "
//		<< clipBox.left << ", " << clipBox.top << ", " << clipBox.right << ", "  << clipBox.bottom;
//	clipBox -= sp;
//	std::cerr << ", now box " << cbType << clipBox.left << ", " << clipBox.top << ", " << clipBox.right << ", " << clipBox.bottom << endl;

	DrawGridGraphics(graphics, clipBox);
	
	for (short i=0; i<NIR(); i++) {
		MFCInstanceView *ir = (MFCInstanceView *)IR(i);
//		cerr << "instance " << ir->bounds.left << ", " << ir->bounds.right << endl;
		if (ir->bounds.Intersects(clipBox)) {
//			cerr << "instersects" << endl;
			ir->Draw(graphics, clipBox);
		}
	}
	for (short i=0; i<NItemR(); i++) {
		MFCEditorItemView *ir = ItemR(i);
		if (ir->type != MFCEditorItemView::DISCRETE && ir->BoundingBox().Intersects(clipBox)) {
			ir->Draw(graphics, clipBox);
		}
	}
	for (short i=0; i<NItemR(); i++) {
		MFCEditorItemView *ir = ItemR(i);
		if (ir->type == MFCEditorItemView::DISCRETE && ir->BoundingBox().Intersects(clipBox)) {
			ir->Draw(graphics, clipBox);
		}
	}
	// draw envelopes

	// draw cursor (erase old one?)
	DrawCursor(graphics, clipBox);
#else
	DrawGrid(pdc, &clipBox);
	for (short i=0; i<NIR(); i++) {
		MFCInstanceView *ir = (MFCInstanceView *)IR(i);
		ir->Draw(pdc, &clipBox);
	}
	// draw envelopes

	// draw cursor (erase old one?)
	DrawCursor(pdc, &clipBox);
#endif
}
void CGPSRobotHostView::OnDraw(CDC* pDC)
{
	CGPSRobotHostDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}
Beispiel #21
0
void C飞机大战View::OnDraw(CDC* pDC)
{
	
	
	C飞机大战Doc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

	// TODO: 在此处为本机数据添加绘制代码

	//双缓冲

	 CRect rc; 
     CDC MecDC; 
     GetClientRect(&rc); 
     CBitmap bmp; //内存中承载临时图象的位图 

     MecDC.CreateCompatibleDC(pDC); //依附窗口DC创建兼容内存DC 
 	 //bmp.CreateCompatibleBitmap(pDC,rc.right,rc.bottom); //创建兼容位图(必须用pDC创建,否则画出的图形变成黑色)
	 bmp.LoadBitmap(IDB_SKY);//插入背景图片
     CBitmap *pOldBit=MecDC.SelectObject(&bmp); //该函数选择一对象到指定的设备上下文环境中,该新对象替换先前的相同类型的对象。
   
	// MecDC.FillSolidRect(0,0,rc.right,rc.bottom,RGB(100,149,237));  //按原来背景填充客户区,不然会是黑色


	/******************战机*********************/
	 if(n>0)
	 {
		myplane.Draw(&MecDC,TRUE);
	 }
	
	//*****************输出敌机****************/
      if(m==0)
	  {  
		  number=10;//rand()%10+1;
	  }else if(m==30)
	  {
		  number=25;//rand()%25+1;
	  }else if(m==50)
	  {
		  number=35;//rand()%45+1;
	  }else if(m==100)
	  {
          number=45;//rand()%75+1;
	  }else if(m==150)
	  {
          number=65;//rand()%100+1;
	  }


	  
	 if(oblenemy.GetCount()<number)//生成敌机链表
	 {
	 
		 int x=rand()%970;
		 int n=rand()%2?1:-1;//随机的产生上下两个方向
		 CEnemy* pEnemy=new CEnemy(x,n==1?0:600,n);//生成敌机
		 oblenemy.AddHead(pEnemy);

	 }
	 POSITION pos=oblenemy.GetHeadPosition();
	 while(pos!=0)//遍历敌机,碰到越界的就将其删除
	 {
		 POSITION dpos=pos;
		 CEnemy* pEnemy=(CEnemy*)oblenemy.GetNext(pos);//传给下一个地址
		 if(pEnemy->GetPoint().y>600||pEnemy->GetPoint().y<0)//删除敌机
		 {
			 oblenemy.RemoveAt(dpos);
			 delete pEnemy;
			 continue;
		 }
		  pEnemy->Draw(&MecDC,TRUE);//画图
	 }




   //**************敌机被击中  碰撞检测//绘制战机子弹*******************/


   if(n>0&&obl.IsEmpty()==0)//isempty 不是空的时候返回0,判断导弹是否为空o存在战机
{
	
		//第一个导弹第一个位置
		CBomb* pBomb=(CBomb*)obl.GetHead();
        POSITION pos=obl.GetHeadPosition();

		bool isFired =false;//是否可以被击中
		while(pos!=NULL)//遍历导弹
		{
		//第一个导弹发射以后,画导弹,自动赋值给下一个导弹
		    POSITION dpos=pos;
			pBomb=(CBomb*)obl.GetNext(pos);
			/**************************矩形区域********************************/
			//导弹的矩形区域
			CRect One = CRect(pBomb->GetPoint().x,pBomb->GetPoint().y,(pBomb->GetPoint().x)+10,(pBomb->GetPoint().y)+20);
			
			
			if(oblenemy.IsEmpty()==0)//判断敌机是否为空
            {
				POSITION posD=oblenemy.GetHeadPosition();
				
				CEnemy* pEnemy=(CEnemy*)oblenemy.GetHead();
				while(posD!=NULL)//遍历敌机
				{
					POSITION dposD=posD;
					CEnemy* pEnemy=(CEnemy*)oblenemy.GetNext(posD);

				/**************************矩形区域********************************/
				//	敌机的矩形区域
				CRect Two = CRect(pEnemy->GetPoint().x,pEnemy->GetPoint().y,(pEnemy->GetPoint().x) +35,(pEnemy->GetPoint().y)+35);
				CRect Inter;
				if(Inter.IntersectRect(One,Two))//相撞
				{
				    PlaySound(TEXT("../sound/bomb.wav"),NULL,SND_FILENAME | SND_ASYNC);
				    m++;
					 //画爆炸图片
					CExplosion* newplosion=new CExplosion(pEnemy->GetPoint().x,pEnemy->GetPoint().y);
					newplosion->Draw(&MecDC,TRUE);	
					//删除敌机
					oblenemy.RemoveAt(dposD);
					delete pEnemy;
					//删除爆炸图片
					delete newplosion;
					isFired = true;//确定被击中
					break;
				}
				}
				
			}
			if(!isFired)
			pBomb->Draw(&MecDC,TRUE);//画导弹
			else
			{
				//删除炸弹
				obl.RemoveAt(dpos);
				delete pBomb;
			}
			
				
		}
}

//**********************敌机与战机相撞*****************/
   if(n>0&&oblenemy.IsEmpty()==0)
   {
       POSITION posD=oblenemy.GetHeadPosition();
				
	   CEnemy* pEnemy=(CEnemy*)oblenemy.GetHead();
		while(posD!=NULL)//遍历敌机
			{
					POSITION dposD=posD;
					CEnemy* pEnemy=(CEnemy*)oblenemy.GetNext(posD);

				/**************************矩形区域********************************/
				//	敌机的矩形区域该对象或结构包含了一个源矩形
				CRect Three = CRect(pEnemy->GetPoint().x,pEnemy->GetPoint().y,(pEnemy->GetPoint().x) +35,(pEnemy->GetPoint().y)+35);
				//战机的矩形新区域该对象或结构包含了一个源矩形
				CRect Four = CRect(myplane.GetPoint().x,myplane.GetPoint().y,myplane.GetPoint().x+50,myplane.GetPoint().y+60);
				CRect Inter2;//此函数使Inter2等于两个现有矩形的交。即是两个源矩形的重合部分。
				if(Inter2.IntersectRect(Three,Four))//相撞,如果交Inter2不为空,则返回非零值;否则,如果交为空则返回0。
				{
				    PlaySound(TEXT("../sound/bomb.wav"),NULL,SND_FILENAME | SND_ASYNC);
				    m++;
					 //画爆炸图片
					CExplosion* newplosion=new CExplosion(pEnemy->GetPoint().x,pEnemy->GetPoint().y);
					newplosion->Draw(&MecDC,TRUE);	
					//删除敌机
					oblenemy.RemoveAt(dposD);
					delete pEnemy;
					//删除爆炸图片
					delete newplosion;
	                 n--;
					break;
				}
		  }
   }

			
//*********************绘制敌机的子弹,炸掉战机**********/
  
 //便利符合条件的敌机,存储子弹
	 POSITION pos3=oblenemy.GetHeadPosition();
	 
	 bool isFired =false;//是否可以被击中
	   while(pos3!=NULL)
     {
		 CEnemy* pEnemy=(CEnemy*)oblenemy.GetNext(pos3);
	  
		int find=0;//用于判断是否符合发射子弹的条件
		if(myplane.GetPoint().x>=pEnemy->GetPoint().x-50&&myplane.GetPoint().x<pEnemy->GetPoint().x+35)
   
	     {
			 if((pEnemy->GetMontion()==1&&myplane.GetPoint().y>pEnemy->GetPoint().y)||(pEnemy->GetMontion()==-1&&myplane.GetPoint().y<pEnemy->GetPoint().y))
			 {
				 find=1;//符合条件
				 if(pEnemy->m_nWait%20==0)//延时发射
				 {
		            CBall *pBall=new CBall(pEnemy->GetPoint().x+17,pEnemy->GetPoint().y,pEnemy->GetMontion());
	                oblball.AddHead(pBall);
				 }
				 pEnemy->m_nWait++;//存储子弹,延时20个刷新时间
			 }
        }
	   if(find==0)
			pEnemy->m_nWait=0;//不符合发射条件的时候就初始位置置位0

     }   
//准备发射子弹
	   if(n>0&&oblball.IsEmpty()==0)//isempty 不是空的时候返回0,战机存在才会发子弹
     {
		//第一个子弹第一个位置
		 CBall* pBall=(CBall*)oblball.GetHead();
        POSITION pos=oblball.GetHeadPosition();
        
		while(pos!=NULL)//遍历子弹
		{
			POSITION dpos=pos;
		  //第一个子弹发射以后,画子弹,自动赋值给下一个子弹位置
			CBall* pBall=(CBall*)oblball.GetNext(pos);
			//子弹的越界删除
			if(pBall->GetPoint().y>600||pBall->GetPoint().y<0)//删除敌机
		       {
			     oblball.RemoveAt(dpos);
			     delete pBall;
			     continue;
		       }
			//没有越界子弹爆炸
			if(pBall->GetPoint().x>=myplane.GetPoint().x-10&&pBall->GetPoint().x<=myplane.GetPoint().x+50)
			if(pBall->GetPoint().y>=myplane.GetPoint().y-10&&pBall->GetPoint().y<=myplane.GetPoint().y+60)
			{
				if(n>0)
				{			
					 PlaySound(TEXT("../sound/bomb.wav"),NULL,SND_FILENAME | SND_ASYNC);
					CExplosion* newplosion=new CExplosion(myplane.GetPoint().x,myplane.GetPoint().y);
					newplosion->Draw(&MecDC,TRUE);								
					delete newplosion;

					oblball.RemoveAt(dpos);
					delete pBall;
					n--;//判断战机生命值
					
					isFired = true;
					break;//一个子弹只打一个飞机
				}
				
			}
            
			if(!isFired)
			pBall->Draw(&MecDC,TRUE);
			
			
		}
     }
	   
	   
//*********************道具**********************/
	 DaoJu_Waite++;//控制出精灵的时间
	 if(DaoJu_Waite==100)
	 {
		 DaoJu_Waite=0;
		 int x=rand()%970;
		 int y=rand()%600;
		 CDaoju* pDaoju=new CDaoju(x,y);
		 obldaoju.AddHead(pDaoju);
	 }
	 POSITION posW=obldaoju.GetHeadPosition();
	 while(posW!=0)//遍历敌机,碰到越界的就将其删除
	 {
		 POSITION dposW=posW;
		 CDaoju* pDaoju=(CDaoju*)obldaoju.GetNext(posW);//传给下一个地址
		 if(pDaoju->GetPoint().y>600)//删除敌机
		 {
			 obldaoju.RemoveAt(dposW);
			 delete pDaoju;
			 continue;
		 }
		 //	道具的矩形区域该对象或结构包含了一个源矩形
		 CRect DAOJU = CRect(pDaoju->GetPoint().x,pDaoju->GetPoint().y,(pDaoju->GetPoint().x) +29,(pDaoju->GetPoint().y)+28);
		 //战机的矩形新区域该对象或结构包含了一个源矩形
		 CRect ZHANJI = CRect(myplane.GetPoint().x,myplane.GetPoint().y,myplane.GetPoint().x+50,myplane.GetPoint().y+60);
		 CRect Inter3;//此函数使Inter2等于两个现有矩形的交。即是两个源矩形的重合部分。
		 if(Inter3.IntersectRect(DAOJU,ZHANJI))
		 {
			 n+=5;
			 obldaoju.RemoveAt(dposW);
			 delete pDaoju;
			 continue;
		 }
		  pDaoju->Draw(&MecDC,TRUE);//画图
	 }

	 /***************************大招**********************/
	 if(GetKey('S'))
	 {
		 if(m>80&&n>50)
		 {
			 if(oblenemy.IsEmpty()==0)
			 {
                  POSITION posS=oblenemy.GetHeadPosition();
				
				  CEnemy* pEnemy=(CEnemy*)oblenemy.GetHead();
				  while(posS!=NULL)//遍历敌机
					{
					  POSITION dposS=posS;
					  CEnemy* pEnemy=(CEnemy*)oblenemy.GetNext(posS);
					  if(pEnemy->GetPoint().x>0&&pEnemy->GetPoint().x<970)
						  if(pEnemy->GetPoint().y>0&&pEnemy->GetPoint().y<600)
						  {
							  PlaySound(TEXT("../sound/bomb.wav"),NULL,SND_FILENAME | SND_ASYNC);
							  m++;
							 //画爆炸图片
							  CExplosion* newplosion=new CExplosion(pEnemy->GetPoint().x,pEnemy->GetPoint().y);
							  newplosion->Draw(&MecDC,TRUE);	
							//删除敌机
							  oblenemy.RemoveAt(dposS);
						      delete pEnemy;
					        //删除爆炸图片
					          delete newplosion;
							 

						  }

					}
				   n-=10;
			 }
		 }
	 }


	   /*******************输出文字*************************/
	 	
		CFont*  m_pFont=new CFont;
		LOGFONT lf; 
        MecDC.SelectObject(*m_pFont); 
		
		MecDC.SetTextColor(RGB(255,255,0));//颜色
		MecDC.SetBkMode(TRANSPARENT);//透明
		CString s,sm,sgq;
		//int n;
		s.Format(TEXT("消灭敌机的数量: %d"),m);
		sm.Format(TEXT("战机的生命值为:%d"),n);

		MecDC.TextOutW(10,10,s);
		MecDC.TextOutW(10,30,sm);
		MecDC.TextOutW(10,50,_T("您所在的关卡:"));
		if(m<30)
		{ 
            MecDC.TextOutW(110,50,_T("第一关"));
		}else if(m<50&&m>=30 )
		{
			MecDC.TextOutW(110,50,_T("第二关"));
		}else  if(m<100&&m>=50)
		{
			MecDC.TextOutW(110,50,_T("第三关"));
		}else if(m>100&&m<=150)
		{
            MecDC.TextOutW(110,50,_T("第四关"));
		}	
			if(m>150&&m<300)
		{
			MecDC.TextOutW(110,50,_T("迎接无敌状态吧!!!!"));			
		}else if(m>=300&&n!=0)
		{
            
            memset(&lf, 0, sizeof(LOGFONT));		
			lf.lfHeight  = 80;  
			lf.lfWeight  = 20;  
			m_pFont->CreateFontIndirect(&lf); //创建字体
			MecDC.SelectObject(*m_pFont); //设为默认的字体
			MecDC.TextOutW(100,300,_T("恭喜你,通关了!!!"));
            KillTimer(1);
			delete m_pFont;


		}
		if(n==0)
		{
			memset(&lf, 0, sizeof(LOGFONT));		
			lf.lfHeight  = 80;  
			lf.lfWeight  = 20;  
			m_pFont->CreateFontIndirect(&lf); //创建字体
			MecDC.SelectObject(*m_pFont); //设为默认的字体
			MecDC.TextOutW(300,300,_T("游戏结束!!!"));
			delete m_pFont;
			//可以改成图片,但是没有合适的
			 /*CImageList images;
			 CBitmap bmp1;
			 bmp1.LoadBitmap(IDB_GAMEOVER);
			 images.Create(220,220,ILC_COLOR24,0,1);
			 images.Add(&bmp1,RGB(0,0,0));
			 images.Draw(&MecDC,0,CPoint(300,160),ILD_TRANSPARENT);*/
		}



	//双缓冲
	pDC->BitBlt(0,0,rc.right,rc.bottom,&MecDC,0,0,SRCCOPY);////将内存DC上的图象拷贝到前台 

     //绘图完成后的清理
    MecDC.DeleteDC();//删除DC

    bmp.DeleteObject(); //删除位图
	SetTimer(1,40,NULL);
	//通关
	if(m>=300&&n!=0)
		KillTimer(1);

	
}
Beispiel #22
0
void CFormEditor::LoadData(int bCheckNew) 
{
	if(m_pDialog)
	{
		m_pDialog->ClearData();
		if(AllElements.GetTypeString()=="Массив"||AllElements.GetTypeString()=="Структура")
		{
			CValue ObjectVal=AllElements.GetAt("Форма");
			if(ObjectVal.GetSizeStrArray()>0)
			{
				m_pDialog->m_csName=ObjectVal.GetAt("Идентификатор");
				m_pDialog->m_csValue=ObjectVal.GetAt("Заголовок");
				m_pDialog->csAlias=ObjectVal.GetAt("Синоним");
				m_pDialog->csComment=ObjectVal.GetAt("Комментарий");
				m_pDialog->bCanResize=ObjectVal.GetAt("НеИзменятьРазмер");
				m_pDialog->m_nIcon=ObjectVal.GetAt("Иконка");
		
				CRect Rect;
				Rect.left=ObjectVal.GetAt("x1");
				Rect.top=ObjectVal.GetAt("y1");
				Rect.right=ObjectVal.GetAt("x2");
				Rect.bottom=ObjectVal.GetAt("y2");

				m_pDialog->MoveWindow(Rect.left, Rect.top, Rect.right-Rect.left, Rect.bottom-Rect.top,1);
			}

			//слои (доп. информация)
			ObjectVal=AllElements.GetAt("Слои");
			for(int l=0;l<ObjectVal.GetSizeArray();l++)
			{
				CValue vLayer=ObjectVal.GetAt(l+1);
				if(vLayer.GetSizeStrArray()>0)
				{
					CString csName=vLayer.GetAt("Name");
					int bVisible=vLayer.GetAt("Visible");
					int bActivate=vLayer.GetAt("Activate");
					m_Layers.AddLayer(csName,bVisible,bActivate);
				}
			}

			for(int i=0;i<AllElements.GetSizeArray();i++)
			{
				ObjectVal=AllElements.GetAt(i+1);
				CDynControl *pControl=m_pDialog->AddControl(ObjectVal);
				CChangeOrderItem data;
				data.csCapture=ObjectVal.GetAt("Заголовок");
				data.csType=ObjectVal.GetAt("ТипЭлемента");
				data.csId=ObjectVal.GetAt("Идентификатор");
				data.csLayer=ObjectVal.GetAt("Слой");
				data.pControl=pControl;
				m_aChangeOrder.Add(data);
				pControl->OnUpdate();

				//корректируем список слоев
				m_Layers.AddLayer(pControl->m_csLayer,0,0);

			}
			m_pDialog->ReloadWindows();
			m_Layers.ReLoadGrid();
			
		}
		else
		if(bCheckNew)
		{
			((CModuleDoc*)GetDocument())->nCanDefualtType=DEFAULT_FORM_MODULE;//форма

			CDynControl *pControl;
			pControl=m_pDialog->AddControl(ID_DYNBUTTON,CPoint(240,255));
			pControl->m_csValue="Выполнить";
			pControl->m_csName="Выполнить";
			pControl->SetFuncProperty("Нажатие","Выполнить");
			pControl->OnUpdate();

			pControl=m_pDialog->AddControl(ID_DYNBUTTON,CPoint(340,255));
			pControl->m_csValue="Закрыть";
			pControl->m_csName="Закрыть";
			pControl->SetFuncProperty("Нажатие","ЗакрытьФорму");
			pControl->SetFuncProperty("Кнопка по умолчанию",1);
			
			pControl->OnUpdate();
			m_pDialog->ReloadWindows();
		}
	}
		
}
void CGuiPowerPointView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}
Beispiel #24
0
/*!
	コマンドコードによる処理振り分け

	@param nCommand コマンドコード
	@param lparam1 parameter1(内容はコマンドコードによって変わります)
	@param lparam2 parameter2(内容はコマンドコードによって変わります)
	@param lparam3 parameter3(内容はコマンドコードによって変わります)
	@param lparam4 parameter4(内容はコマンドコードによって変わります)
*/
BOOL CViewCommander::HandleCommand(
	EFunctionCode	nCommand,
	bool			bRedraw,
	LPARAM			lparam1,
	LPARAM			lparam2,
	LPARAM			lparam3,
	LPARAM			lparam4
)
{
	BOOL	bRet = TRUE;
	bool	bRepeat = false;
	int		nFuncID;

	//	May. 19, 2006 genta 上位16bitに送信元の識別子が入るように変更したので
	//	下位16ビットのみを取り出す
	//	Jul.  7, 2007 genta 定数と比較するためにシフトしないで使う
	int nCommandFrom = nCommand & ~0xffff;
	nCommand = (EFunctionCode)LOWORD( nCommand );


	if( m_pCommanderView->m_nAutoScrollMode && F_AUTOSCROLL != nCommand ){
		m_pCommanderView->AutoScrollExit();
	}
	m_pCommanderView->GetCaret().m_bClearStatus = true;
	// -------------------------------------
	//	Jan. 10, 2005 genta
	//	Call message translators
	// -------------------------------------
	m_pCommanderView->TranslateCommand_grep( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 );
	m_pCommanderView->TranslateCommand_isearch( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 );

	// 2013.09.23 novice 機能が利用可能か調べる
	if( !IsFuncEnable( GetDocument(), &GetDllShareData(), nCommand ) ){
		return TRUE;
	}

	++GetDocument()->m_nCommandExecNum;		/* コマンド実行回数 */
//	if( nCommand != F_COPY ){
		/* 辞書Tipを消す */
		m_pCommanderView->m_cTipWnd.Hide();
		m_pCommanderView->m_dwTipTimer = ::GetTickCount();	/* 辞書Tip起動タイマー */
//	}
	/* 印刷プレビューモードか */
//@@@ 2002.01.14 YAZAKI 印刷プレビューをCPrintPreviewに独立させたことによる変更
	if( GetEditWindow()->m_pPrintPreview && F_PRINT_PREVIEW != nCommand ){
		ErrorBeep();
		return -1;
	}
	/* キーリピート状態 */
	if( m_bPrevCommand == nCommand ){
		bRepeat = true;
	}
	m_bPrevCommand = nCommand;
	if( GetDllShareData().m_sFlags.m_bRecordingKeyMacro &&									/* キーボードマクロの記録中 */
		GetDllShareData().m_sFlags.m_hwndRecordingKeyMacro == GetMainWindow() &&	/* キーボードマクロを記録中のウィンドウ */
		( nCommandFrom & FA_NONRECORD ) != FA_NONRECORD	/* 2007.07.07 genta 記録抑制フラグ off */
	){
		/* キーリピート状態をなくする */
		bRepeat = false;
		/* キーマクロに記録可能な機能かどうかを調べる */
		//@@@ 2002.2.2 YAZAKI マクロをCSMacroMgrに統一
		//F_EXECEXTMACROコマンドはファイルを選択した後にマクロ文が確定するため個別に記録する。
		if( CSMacroMgr::CanFuncIsKeyMacro( nCommand ) &&
			nCommand != F_EXECEXTMACRO	//F_EXECEXTMACROは個別で記録します
		){
			/* キーマクロのバッファにデータ追加 */
			//@@@ 2002.1.24 m_CKeyMacroMgrをCEditDocへ移動
			LPARAM lparams[] = {lparam1, lparam2, lparam3, lparam4};
			m_pcSMacroMgr->Append( STAND_KEYMACRO, nCommand, lparams, m_pCommanderView );
		}
	}

	//	2007.07.07 genta マクロ実行中フラグの設定
	//	マクロからのコマンドかどうかはnCommandFromでわかるが
	//	nCommandFromを引数で浸透させるのが大変なので,従来のフラグにも値をコピーする
	m_pCommanderView->m_bExecutingKeyMacro = ( nCommandFrom & FA_FROMMACRO ) ? true : false;

	/* キーボードマクロの実行中 */
	if( m_pCommanderView->m_bExecutingKeyMacro ){
		/* キーリピート状態をなくする */
		bRepeat = false;
	}

	//	From Here Sep. 29, 2001 genta マクロの実行機能追加
	if( F_USERMACRO_0 <= nCommand && nCommand < F_USERMACRO_0 + MAX_CUSTMACRO ){
		//@@@ 2002.2.2 YAZAKI マクロをCSMacroMgrに統一(インターフェースの変更)
		if( !m_pcSMacroMgr->Exec( nCommand - F_USERMACRO_0, G_AppInstance(), m_pCommanderView,
			nCommandFrom & FA_NONRECORD )){
			InfoMessage(
				this->m_pCommanderView->m_hwndParent,
				LS(STR_ERR_MACRO1),
				nCommand - F_USERMACRO_0,
				m_pcSMacroMgr->GetFile( nCommand - F_USERMACRO_0 )
			);
		}
		return TRUE;
	}
	//	To Here Sep. 29, 2001 genta マクロの実行機能追加

	// -------------------------------------
	//	Jan. 10, 2005 genta
	//	Call mode basis message handler
	// -------------------------------------
	m_pCommanderView->PreprocessCommand_hokan(nCommand);
	if( m_pCommanderView->ProcessCommand_isearch( nCommand, bRedraw, lparam1, lparam2, lparam3, lparam4 ))
		return TRUE;

	// -------------------------------------
	//	Jan. 10, 2005 genta コメント
	//	ここより前ではUndoバッファの準備ができていないので
	//	文書の操作を行ってはいけない
	//@@@ 2002.2.2 YAZAKI HandleCommand内でHandleCommandを呼び出せない問題に対処(何か副作用がある?)
	if( NULL == GetOpeBlk() ){	/* 操作ブロック */
		SetOpeBlk(new COpeBlk);
	}
	GetOpeBlk()->AddRef();	//参照カウンタ増加

	//	Jan. 10, 2005 genta コメント
	//	ここより後ではswitchの後ろでUndoを正しく登録するため,
	//	途中で処理の打ち切りを行ってはいけない
	// -------------------------------------

	switch( nCommand ){
	case F_WCHAR:	/* 文字入力 */
		{
			Command_WCHAR( (wchar_t)lparam1 );
		}
		break;

	/* ファイル操作系 */
	case F_FILENEW:				Command_FILENEW();break;			/* 新規作成 */
	case F_FILENEW_NEWWINDOW:	Command_FILENEW_NEWWINDOW();break;
	//	Oct. 2, 2001 genta マクロ用機能拡張
	case F_FILEOPEN:			Command_FILEOPEN((const WCHAR*)lparam1);break;			/* ファイルを開く */
	case F_FILEOPEN2:			Command_FILEOPEN((const WCHAR*)lparam1, (ECodeType)lparam2, lparam3 != 0, (const WCHAR*)lparam4);break;	//ファイルを開く2
	case F_FILEOPEN_DROPDOWN:	Command_FILEOPEN((const WCHAR*)lparam1);break;			/* ファイルを開く(ドロップダウン) */	//@@@ 2002.06.15 MIK
	case F_FILESAVE:			bRet = Command_FILESAVE();break;	/* 上書き保存 */
	case F_FILESAVEAS_DIALOG:	bRet = Command_FILESAVEAS_DIALOG((const WCHAR*)lparam1, (ECodeType)lparam2, (EEolType)lparam3);break;	/* 名前を付けて保存 */
	case F_FILESAVEAS:			bRet = Command_FILESAVEAS((const WCHAR*)lparam1,(EEolType)lparam3);break;	/* 名前を付けて保存 */
	case F_FILESAVEALL:			bRet = Command_FILESAVEALL();break;	/* 全ての編集ウィンドウで上書き保存 */ // Jan. 23, 2005 genta
	case F_FILESAVE_QUIET:		bRet = Command_FILESAVE(false,false); break;	/* 静かに上書き保存 */ // Jan. 24, 2005 genta
	case F_FILESAVECLOSE:
		//	Feb. 28, 2004 genta 保存&閉じる
		//	保存が不要なら単に閉じる
		{	// Command_FILESAVE()とは別に保存不要をチェック	//### Command_FILESAVE() は実際に保存した場合だけ true を返すようになった(仕様変更?)
			if( !GetDllShareData().m_Common.m_sFile.m_bEnableUnmodifiedOverwrite && !GetDocument()->m_cDocEditor.IsModified() ){
				Command_WINCLOSE();
				break;
			}
		}
		if( Command_FILESAVE( false, true )){
			Command_WINCLOSE();
		}
		break;
	case F_FILECLOSE:										//閉じて(無題)	//Oct. 17, 2000 jepro 「ファイルを閉じる」というキャプションを変更
		Command_FILECLOSE();
		break;
	case F_FILECLOSE_OPEN:	/* 閉じて開く */
		Command_FILECLOSE_OPEN();
		break;
	case F_FILE_REOPEN:				Command_FILE_REOPEN( GetDocument()->GetDocumentEncoding(), lparam1!=0 );break;//	Dec. 4, 2002 genta
	case F_FILE_REOPEN_SJIS:		Command_FILE_REOPEN( CODE_SJIS, lparam1!=0 );break;		//SJISで開き直す
	case F_FILE_REOPEN_JIS:			Command_FILE_REOPEN( CODE_JIS, lparam1!=0 );break;		//JISで開き直す
	case F_FILE_REOPEN_EUC:			Command_FILE_REOPEN( CODE_EUC, lparam1!=0 );break;		//EUCで開き直す
	case F_FILE_REOPEN_LATIN1:		Command_FILE_REOPEN( CODE_LATIN1, lparam1!=0 );break;	//Latin1で開きなおす	// 2010/3/20 Uchi
	case F_FILE_REOPEN_UNICODE:		Command_FILE_REOPEN( CODE_UNICODE, lparam1!=0 );break;	//Unicodeで開き直す
	case F_FILE_REOPEN_UNICODEBE: 	Command_FILE_REOPEN( CODE_UNICODEBE, lparam1!=0 );break;	//UnicodeBEで開き直す
	case F_FILE_REOPEN_UTF8:		Command_FILE_REOPEN( CODE_UTF8, lparam1!=0 );break;		//UTF-8で開き直す
	case F_FILE_REOPEN_CESU8:		Command_FILE_REOPEN( CODE_CESU8, lparam1!=0 );break;	//CESU-8で開きなおす
	case F_FILE_REOPEN_UTF7:		Command_FILE_REOPEN( CODE_UTF7, lparam1!=0 );break;		//UTF-7で開き直す
	case F_PRINT:				Command_PRINT();break;					/* 印刷 */
	case F_PRINT_PREVIEW:		Command_PRINT_PREVIEW();break;			/* 印刷プレビュー */
	case F_PRINT_PAGESETUP:		Command_PRINT_PAGESETUP();break;		/* 印刷ページ設定 */	//Sept. 14, 2000 jepro 「印刷のページレイアウトの設定」から変更
	case F_OPEN_HfromtoC:		bRet = Command_OPEN_HfromtoC( (BOOL)lparam1 );break;	/* 同名のC/C++ヘッダ(ソース)を開く */	//Feb. 7, 2001 JEPRO 追加
//	case F_OPEN_HHPP:			bRet = Command_OPEN_HHPP( (BOOL)lparam1, TRUE );break;		/* 同名のC/C++ヘッダファイルを開く */	//Feb. 9, 2001 jepro「.cまたは.cppと同名の.hを開く」から変更		del 2008/6/23 Uchi
//	case F_OPEN_CCPP:			bRet = Command_OPEN_CCPP( (BOOL)lparam1, TRUE );break;		/* 同名のC/C++ソースファイルを開く */	//Feb. 9, 2001 jepro「.hと同名の.c(なければ.cpp)を開く」から変更	del 2008/6/23 Uchi
	case F_ACTIVATE_SQLPLUS:	Command_ACTIVATE_SQLPLUS();break;		/* Oracle SQL*Plusをアクティブ表示 */
	case F_PLSQL_COMPILE_ON_SQLPLUS:									/* Oracle SQL*Plusで実行 */
		Command_PLSQL_COMPILE_ON_SQLPLUS();
		break;
	case F_BROWSE:				Command_BROWSE();break;				/* ブラウズ */
	case F_VIEWMODE:			Command_VIEWMODE();break;			/* ビューモード */
	case F_PROPERTY_FILE:		Command_PROPERTY_FILE();break;		/* ファイルのプロパティ */
	case F_OPEN_FOLDER_IN_EXPLORER:		Command_OPEN_FOLDER_IN_EXPLORER();break;	/* ファイルの場所を開く */
	case F_OPEN_COMMAND_PROMPT:				Command_OPEN_COMMAND_PROMPT(FALSE);break;		/* コマンドプロンプトを開く */
	case F_OPEN_COMMAND_PROMPT_AS_ADMIN:	Command_OPEN_COMMAND_PROMPT(TRUE);break;		/* 管理者としてコマンドプロンプトを開く */
	case F_OPEN_POWERSHELL:				Command_OPEN_POWERSHELL(FALSE);break;		/* PowerShellを開く */
	case F_OPEN_POWERSHELL_AS_ADMIN:	Command_OPEN_POWERSHELL(TRUE);break;		/* 管理者としてPowerShellを開く */
	case F_PROFILEMGR:			Command_PROFILEMGR();break;			// プロファイルマネージャ
	case F_EXITALLEDITORS:		Command_EXITALLEDITORS();break;		/* 編集の全終了 */	// 2007.02.13 ryoji 追加
	case F_EXITALL:				Command_EXITALL();break;			/* サクラエディタの全終了 */	//Dec. 26, 2000 JEPRO 追加
	case F_PUTFILE:				Command_PUTFILE((LPCWSTR)lparam1, (ECodeType)lparam2, (int)lparam3);break;	/* 作業中ファイルの一時出力 */ //maru 2006.12.10
	case F_INSFILE:				Command_INSFILE((LPCWSTR)lparam1, (ECodeType)lparam2, (int)lparam3);break;	/* キャレット位置にファイル挿入 */ //maru 2006.12.10

	/* 編集系 */
	case F_UNDO:				Command_UNDO();break;				/* 元に戻す(Undo) */
	case F_REDO:				Command_REDO();break;				/* やり直し(Redo) */
	case F_DELETE:				Command_DELETE(); break;			//削除
	case F_DELETE_BACK:			Command_DELETE_BACK(); break;		//カーソル前を削除
	case F_WordDeleteToStart:	Command_WordDeleteToStart(); break;	//単語の左端まで削除
	case F_WordDeleteToEnd:		Command_WordDeleteToEnd(); break;	//単語の右端まで削除
	case F_WordDelete:			Command_WordDelete(); break;		//単語削除
	case F_WordCut:				Command_WordCut(); break;			//単語切り取り
	case F_LineCutToStart:		Command_LineCutToStart(); break;	//行頭まで切り取り(改行単位)
	case F_LineCutToEnd:		Command_LineCutToEnd(); break;		//行末まで切り取り(改行単位)
	case F_LineDeleteToStart:	Command_LineDeleteToStart(); break;	//行頭まで削除(改行単位)
	case F_LineDeleteToEnd:		Command_LineDeleteToEnd(); break;	//行末まで削除(改行単位)
	case F_CUT_LINE:			Command_CUT_LINE();break;			//行切り取り(折り返し単位)
	case F_DELETE_LINE:			Command_DELETE_LINE();break;		//行削除(折り返し単位)
	case F_DUPLICATELINE:		Command_DUPLICATELINE();break;		//行の二重化(折り返し単位)
	case F_INDENT_TAB:			Command_INDENT( WCODE::TAB, INDENT_TAB );break;	//TABインデント
	case F_UNINDENT_TAB:		Command_UNINDENT( WCODE::TAB );break;		//逆TABインデント
	case F_INDENT_SPACE:		Command_INDENT( WCODE::SPACE, INDENT_SPACE );break;	//SPACEインデント
	case F_UNINDENT_SPACE:			Command_UNINDENT( WCODE::SPACE );break;	//逆SPACEインデント
//	case F_WORDSREFERENCE:			Command_WORDSREFERENCE();break;		/* 単語リファレンス */
	case F_LTRIM:					Command_TRIM(TRUE);break;			// 2001.12.03 hor
	case F_RTRIM:					Command_TRIM(FALSE);break;			// 2001.12.03 hor
	case F_SORT_ASC:				Command_SORT(TRUE);break;			// 2001.12.06 hor
	case F_SORT_DESC:				Command_SORT(FALSE);break;			// 2001.12.06 hor
	case F_MERGE:					Command_MERGE();break;				// 2001.12.06 hor
	case F_RECONVERT:				Command_Reconvert();break;			/* メニューからの再変換対応 minfu 2002.04.09 */ 

	/* カーソル移動系 */
	case F_IME_CHAR:		Command_IME_CHAR( (WORD)lparam1 ); break;					//全角文字入力
	case F_MOVECURSOR:			Command_MOVECURSOR(CLogicPoint(CLogicInt((int)lparam2), CLogicInt((int)lparam1)), (int)lparam3); break;
	case F_MOVECURSORLAYOUT:	Command_MOVECURSORLAYOUT(CLayoutPoint(CLayoutInt((int)lparam2), CLayoutInt((int)lparam1)), (int)lparam3); break;
	case F_UP:				Command_UP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;				//カーソル上移動
	case F_DOWN:			Command_DOWN( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;			//カーソル下移動
	case F_LEFT:			Command_LEFT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, bRepeat ); break;			//カーソル左移動
	case F_RIGHT:			Command_RIGHT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, false, bRepeat ); break;	//カーソル右移動
	case F_UP2:				Command_UP2( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;						//カーソル上移動(2行づつ)
	case F_DOWN2:			Command_DOWN2( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;					//カーソル下移動(2行づつ)
	case F_WORDLEFT:		Command_WORDLEFT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				/* 単語の左端に移動 */
	case F_WORDRIGHT:		Command_WORDRIGHT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				/* 単語の右端に移動 */
	//	0ct. 29, 2001 genta マクロ向け機能拡張
	case F_GOLINETOP:		Command_GOLINETOP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, lparam1  ); break;		//行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND:		Command_GOLINEEND( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, 0, lparam1 ); break;		//行末に移動(折り返し単位)
//	case F_ROLLDOWN:		Command_ROLLDOWN( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//スクロールダウン
//	case F_ROLLUP:			Command_ROLLUP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;					//スクロールアップ
	case F_HalfPageUp:		Command_HalfPageUp( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;				//半ページアップ	//Oct. 6, 2000 JEPRO 名称をPC-AT互換機系に変更(ROLL→PAGE) //Oct. 10, 2000 JEPRO 名称変更
	case F_HalfPageDown:	Command_HalfPageDown( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;			//半ページダウン	//Oct. 6, 2000 JEPRO 名称をPC-AT互換機系に変更(ROLL→PAGE) //Oct. 10, 2000 JEPRO 名称変更
	case F_1PageUp:			Command_1PageUp( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;					//1ページアップ	//Oct. 10, 2000 JEPRO 従来のページアップを半ページアップと名称変更し1ページアップを追加
	case F_1PageDown:		Command_1PageDown( m_pCommanderView->GetSelectionInfo().m_bSelectingLock, CLayoutYInt(lparam1) ); break;				//1ページダウン	//Oct. 10, 2000 JEPRO 従来のページダウンを半ページダウンと名称変更し1ページダウンを追加
	case F_GOFILETOP:		Command_GOFILETOP( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//ファイルの先頭に移動
	case F_GOFILEEND:		Command_GOFILEEND( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;				//ファイルの最後に移動
	case F_CURLINECENTER:	Command_CURLINECENTER(); break;								/* カーソル行をウィンドウ中央へ */
	case F_JUMPHIST_PREV:	Command_JUMPHIST_PREV(); break;								//移動履歴: 前へ
	case F_JUMPHIST_NEXT:	Command_JUMPHIST_NEXT(); break;								//移動履歴: 次へ
	case F_JUMPHIST_SET:	Command_JUMPHIST_SET(); break;								//現在位置を移動履歴に登録
	case F_WndScrollDown:	Command_WndScrollDown(); break;								//テキストを1行下へスクロール	// 2001/06/20 asa-o
	case F_WndScrollUp:		Command_WndScrollUp(); break;								//テキストを1行上へスクロール	// 2001/06/20 asa-o
	case F_GONEXTPARAGRAPH:	Command_GONEXTPARAGRAPH( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;			//次の段落へ進む
	case F_GOPREVPARAGRAPH:	Command_GOPREVPARAGRAPH( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;			//前の段落へ戻る
	case F_AUTOSCROLL:	Command_AUTOSCROLL(); break;	//オートスクロール
	case F_WHEELUP:			Command_WHEELUP(lparam1); break;
	case F_WHEELDOWN:		Command_WHEELDOWN(lparam1); break;
	case F_WHEELLEFT:		Command_WHEELLEFT(lparam1); break;
	case F_WHEELRIGHT:		Command_WHEELRIGHT(lparam1); break;
	case F_WHEELPAGEUP:		Command_WHEELPAGEUP(lparam1); break;
	case F_WHEELPAGEDOWN:	Command_WHEELPAGEDOWN(lparam1); break;
	case F_WHEELPAGELEFT:	Command_WHEELPAGELEFT(lparam1); break;
	case F_WHEELPAGERIGHT:	Command_WHEELPAGERIGHT(lparam1); break;
	case F_MODIFYLINE_NEXT:	Command_MODIFYLINE_NEXT( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;	// 次の変更行へ
	case F_MODIFYLINE_PREV:	Command_MODIFYLINE_PREV( m_pCommanderView->GetSelectionInfo().m_bSelectingLock ); break;	// 前の変更行へ

	/* 選択系 */
	case F_SELECTWORD:		Command_SELECTWORD();break;						//現在位置の単語選択
	case F_SELECTALL:		Command_SELECTALL();break;						//すべて選択
	case F_SELECTLINE:		Command_SELECTLINE( lparam1 );break;			//1行選択	// 2007.10.13 nasukoji
	case F_BEGIN_SEL:		Command_BEGIN_SELECT();break;					/* 範囲選択開始 */
	case F_UP_SEL:			Command_UP( true, bRepeat, lparam1 ); break;	//(範囲選択)カーソル上移動
	case F_DOWN_SEL:		Command_DOWN( true, bRepeat ); break;			//(範囲選択)カーソル下移動
	case F_LEFT_SEL:		Command_LEFT( true, bRepeat ); break;			//(範囲選択)カーソル左移動
	case F_RIGHT_SEL:		Command_RIGHT( true, false, bRepeat ); break;	//(範囲選択)カーソル右移動
	case F_UP2_SEL:			Command_UP2( true ); break;						//(範囲選択)カーソル上移動(2行ごと)
	case F_DOWN2_SEL:		Command_DOWN2( true );break;					//(範囲選択)カーソル下移動(2行ごと)
	case F_WORDLEFT_SEL:	Command_WORDLEFT( true );break;					//(範囲選択)単語の左端に移動
	case F_WORDRIGHT_SEL:	Command_WORDRIGHT( true );break;				//(範囲選択)単語の右端に移動
	case F_GOLINETOP_SEL:	Command_GOLINETOP( true, lparam1 );break;		//(範囲選択)行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND_SEL:	Command_GOLINEEND( true, 0, lparam1 );break;	//(範囲選択)行末に移動(折り返し単位)
//	case F_ROLLDOWN_SEL:	Command_ROLLDOWN( TRUE ); break;				//(範囲選択)スクロールダウン
//	case F_ROLLUP_SEL:		Command_ROLLUP( TRUE ); break;					//(範囲選択)スクロールアップ
	case F_HalfPageUp_Sel:	Command_HalfPageUp( true, CLayoutYInt(lparam1) ); break;				//(範囲選択)半ページアップ
	case F_HalfPageDown_Sel:Command_HalfPageDown( true, CLayoutYInt(lparam1) ); break;			//(範囲選択)半ページダウン
	case F_1PageUp_Sel:		Command_1PageUp( true, CLayoutYInt(lparam1) ); break;					//(範囲選択)1ページアップ
	case F_1PageDown_Sel:	Command_1PageDown( true, CLayoutYInt(lparam1) ); break;				//(範囲選択)1ページダウン
	case F_GOFILETOP_SEL:	Command_GOFILETOP( true );break;				//(範囲選択)ファイルの先頭に移動
	case F_GOFILEEND_SEL:	Command_GOFILEEND( true );break;				//(範囲選択)ファイルの最後に移動
	case F_GONEXTPARAGRAPH_SEL:	Command_GONEXTPARAGRAPH( true ); break;			//次の段落へ進む
	case F_GOPREVPARAGRAPH_SEL:	Command_GOPREVPARAGRAPH( true ); break;			//前の段落へ戻る
	case F_MODIFYLINE_NEXT_SEL:	Command_MODIFYLINE_NEXT( true ); break;			//(範囲選択)次の変更行へ
	case F_MODIFYLINE_PREV_SEL:	Command_MODIFYLINE_PREV( true ); break;			//(範囲選択)前の変更行へ

	/* 矩形選択系 */
//	case F_BOXSELALL:		Command_BOXSELECTALL();break;		//矩形ですべて選択
	case F_BEGIN_BOX:		Command_BEGIN_BOXSELECT( true );break;	/* 矩形範囲選択開始 */
	case F_UP_BOX:			Sub_BoxSelectLock(lparam1); this->Command_UP( true, bRepeat ); break;		//(矩形選択)カーソル上移動
	case F_DOWN_BOX:		Sub_BoxSelectLock(lparam1); this->Command_DOWN( true, bRepeat ); break;		//(矩形選択)カーソル下移動
	case F_LEFT_BOX:		Sub_BoxSelectLock(lparam1); this->Command_LEFT( true, bRepeat ); break;		//(矩形選択)カーソル左移動
	case F_RIGHT_BOX:		Sub_BoxSelectLock(lparam1); this->Command_RIGHT( true, false, bRepeat ); break;	//(矩形選択)カーソル右移動
	case F_UP2_BOX:			Sub_BoxSelectLock(lparam1); this->Command_UP2( true ); break;				//(矩形選択)カーソル上移動(2行ごと)
	case F_DOWN2_BOX:		Sub_BoxSelectLock(lparam1); this->Command_DOWN2( true );break;				//(矩形選択)カーソル下移動(2行ごと)
	case F_WORDLEFT_BOX:	Sub_BoxSelectLock(lparam1); this->Command_WORDLEFT( true );break;			//(矩形選択)単語の左端に移動
	case F_WORDRIGHT_BOX:	Sub_BoxSelectLock(lparam1); this->Command_WORDRIGHT( true );break;			//(矩形選択)単語の右端に移動
	case F_GOLOGICALLINETOP_BOX:Sub_BoxSelectLock(lparam2); this->Command_GOLINETOP( true, 8 | lparam1 );break;	//(矩形選択)行頭に移動(改行単位)
//	case F_GOLOGICALLINEEND_BOX:Sub_BoxSelectLock(lparam2); this->Command_GOLINEEND( true, 0, 8 | lparam1 );break;	//(矩形選択)行末に移動(改行単位)
	case F_GOLINETOP_BOX:	Sub_BoxSelectLock(lparam2); this->Command_GOLINETOP( true, lparam1 );break;	//(矩形選択)行頭に移動(折り返し単位/改行単位)
	case F_GOLINEEND_BOX:	Sub_BoxSelectLock(lparam2); this->Command_GOLINEEND( true, 0, lparam1 );break;	//(矩形選択)行末に移動(折り返し単位/改行単位)
	case F_HalfPageUp_BOX:	Sub_BoxSelectLock(lparam2); this->Command_HalfPageUp( true, CLayoutYInt(lparam1) ); break;		//(矩形選択)半ページアップ
	case F_HalfPageDown_BOX:Sub_BoxSelectLock(lparam2); this->Command_HalfPageDown( true, CLayoutYInt(lparam1) ); break;		//(矩形選択)半ページダウン
	case F_1PageUp_BOX:		Sub_BoxSelectLock(lparam2); this->Command_1PageUp( true, CLayoutYInt(lparam1) ); break;			//(矩形選択)1ページアップ
	case F_1PageDown_BOX:	Sub_BoxSelectLock(lparam2); this->Command_1PageDown( true, CLayoutYInt(lparam1) ); break;			//(矩形選択)1ページダウン
	case F_GOFILETOP_BOX:	Sub_BoxSelectLock(lparam1); this->Command_GOFILETOP( true );break;			//(矩形選択)ファイルの先頭に移動
	case F_GOFILEEND_BOX:	Sub_BoxSelectLock(lparam1); this->Command_GOFILEEND( true );break;			//(矩形選択)ファイルの最後に移動

	/* クリップボード系 */
	case F_CUT:						Command_CUT();break;					//切り取り(選択範囲をクリップボードにコピーして削除)
	case F_COPY:					Command_COPY( false, GetDllShareData().m_Common.m_sEdit.m_bAddCRLFWhenCopy );break;			//コピー(選択範囲をクリップボードにコピー)
	case F_COPY_ADDCRLF:			Command_COPY( false, true );break;		//折り返し位置に改行をつけてコピー(選択範囲をクリップボードにコピー)
	case F_COPY_CRLF:				Command_COPY( false, GetDllShareData().m_Common.m_sEdit.m_bAddCRLFWhenCopy, EOL_CRLF );break;	//CRLF改行でコピー(選択範囲をクリップボードにコピー)
	case F_PASTE:					Command_PASTE( (int)lparam1 );break;				//貼り付け(クリップボードから貼り付け)
	case F_PASTEBOX:				Command_PASTEBOX( (int)lparam1 );break;				//矩形貼り付け(クリップボードから矩形貼り付け)
	case F_INSBOXTEXT:				Command_INSBOXTEXT((const wchar_t*)lparam1, (int)lparam2 );break;				//矩形テキスト挿入
	case F_INSTEXT_W:				Command_INSTEXT( bRedraw, (const wchar_t*)lparam1, (CLogicInt)lparam2, lparam3!=FALSE );break;/* テキストを貼り付け */ // 2004.05.14 Moca 長さを示す引数追加
	case F_ADDTAIL_W:				Command_ADDTAIL( (const wchar_t*)lparam1, (int)lparam2 );break;	/* 最後にテキストを追加 */
	case F_COPYFNAME:				Command_COPYFILENAME();break;			//このファイル名をクリップボードにコピー / /2002/2/3 aroka
	case F_COPYPATH:				Command_COPYPATH();break;				//このファイルのパス名をクリップボードにコピー
	case F_COPYTAG:					Command_COPYTAG();break;				//このファイルのパス名とカーソル位置をコピー	//Sept. 15, 2000 jepro 上と同じ説明になっていたのを修正
	case F_COPYLINES:				Command_COPYLINES();break;				//選択範囲内全行コピー
	case F_COPYLINESASPASSAGE:		Command_COPYLINESASPASSAGE();break;		//選択範囲内全行引用符付きコピー
	case F_COPYLINESWITHLINENUMBER:	Command_COPYLINESWITHLINENUMBER();break;//選択範囲内全行行番号付きコピー
	case F_COPY_COLOR_HTML:				Command_COPY_COLOR_HTML();break;	//選択範囲内色付きHTMLコピー
	case F_COPY_COLOR_HTML_LINENUMBER:	Command_COPY_COLOR_HTML_LINENUMBER();break;	//選択範囲内行番号色付きHTMLコピー

	case F_CREATEKEYBINDLIST:		Command_CREATEKEYBINDLIST();break;		//キー割り当て一覧をコピー //Sept. 15, 2000 JEPRO 追加 //Dec. 25, 2000 復活

	/* 挿入系 */
	case F_INS_DATE:				Command_INS_DATE();break;	//日付挿入
	case F_INS_TIME:				Command_INS_TIME();break;	//時刻挿入
    case F_CTRL_CODE_DIALOG:		Command_CtrlCode_Dialog();break;	/* コントロールコードの入力(ダイアログ) */	//@@@ 2002.06.02 MIK
    case F_CTRL_CODE:				Command_WCHAR( (wchar_t)lparam1, false );break;

	/* 変換 */
	case F_TOLOWER:					Command_TOLOWER();break;				/* 小文字 */
	case F_TOUPPER:					Command_TOUPPER();break;				/* 大文字 */
	case F_TOHANKAKU:				Command_TOHANKAKU();break;				/* 全角→半角 */
	case F_TOHANKATA:				Command_TOHANKATA();break;				/* 全角カタカナ→半角カタカナ */	//Aug. 29, 2002 ai
	case F_TOZENEI:					Command_TOZENEI();break;				/* 全角→半角 */					//July. 30, 2001 Misaka
	case F_TOHANEI:					Command_TOHANEI();break;				/* 半角→全角 */
	case F_TOZENKAKUKATA:			Command_TOZENKAKUKATA();break;			/* 半角+全ひら→全角・カタカナ */	//Sept. 17, 2000 jepro 説明を「半角→全角カタカナ」から変更
	case F_TOZENKAKUHIRA:			Command_TOZENKAKUHIRA();break;			/* 半角+全カタ→全角・ひらがな */	//Sept. 17, 2000 jepro 説明を「半角→全角ひらがな」から変更
	case F_HANKATATOZENKATA:	Command_HANKATATOZENKAKUKATA();break;	/* 半角カタカナ→全角カタカナ */
	case F_HANKATATOZENHIRA:	Command_HANKATATOZENKAKUHIRA();break;	/* 半角カタカナ→全角ひらがな */
	case F_TABTOSPACE:				Command_TABTOSPACE();break;				/* TAB→空白 */
	case F_SPACETOTAB:				Command_SPACETOTAB();break;				/* 空白→TAB */  //---- Stonee, 2001/05/27
	case F_CODECNV_AUTO2SJIS:		Command_CODECNV_AUTO2SJIS();break;		/* 自動判別→SJISコード変換 */
	case F_CODECNV_EMAIL:			Command_CODECNV_EMAIL();break;			/* E-Mail(JIS→SJIS)コード変換 */
	case F_CODECNV_EUC2SJIS:		Command_CODECNV_EUC2SJIS();break;		/* EUC→SJISコード変換 */
	case F_CODECNV_UNICODE2SJIS:	Command_CODECNV_UNICODE2SJIS();break;	/* Unicode→SJISコード変換 */
	case F_CODECNV_UNICODEBE2SJIS:	Command_CODECNV_UNICODEBE2SJIS();break;	/* UnicodeBE→SJISコード変換 */
	case F_CODECNV_UTF82SJIS:		Command_CODECNV_UTF82SJIS();break;		/* UTF-8→SJISコード変換 */
	case F_CODECNV_UTF72SJIS:		Command_CODECNV_UTF72SJIS();break;		/* UTF-7→SJISコード変換 */
	case F_CODECNV_SJIS2JIS:		Command_CODECNV_SJIS2JIS();break;		/* SJIS→JISコード変換 */
	case F_CODECNV_SJIS2EUC:		Command_CODECNV_SJIS2EUC();break;		/* SJIS→EUCコード変換 */
	case F_CODECNV_SJIS2UTF8:		Command_CODECNV_SJIS2UTF8();break;		/* SJIS→UTF-8コード変換 */
	case F_CODECNV_SJIS2UTF7:		Command_CODECNV_SJIS2UTF7();break;		/* SJIS→UTF-7コード変換 */
	case F_BASE64DECODE:			Command_BASE64DECODE();break;			/* Base64デコードして保存 */
	case F_UUDECODE:				Command_UUDECODE();break;				/* uudecodeして保存 */	//Oct. 17, 2000 jepro 説明を「選択部分をUUENCODEデコード」から変更

	/* 検索系 */
	case F_SEARCH_DIALOG:		Command_SEARCH_DIALOG();break;												//検索(単語検索ダイアログ)
	case F_SEARCH_BOX:			Command_SEARCH_BOX();break;		// Jan. 13, 2003 MIK					//検索(ボックス)	// 2006.06.04 yukihane Command_SEARCH_BOX()
	case F_SEARCH_NEXT:			Command_SEARCH_NEXT( true, bRedraw, false, (HWND)lparam1, (const WCHAR*)lparam2 );break;	//次を検索
	case F_SEARCH_PREV:			Command_SEARCH_PREV( bRedraw, (HWND)lparam1 );break;						//前を検索
	case F_REPLACE_DIALOG:	//置換(置換ダイアログ)
		Command_REPLACE_DIALOG();	//@@@ 2002.2.2 YAZAKI ダイアログ呼び出しと、実行を分離
		break;
	case F_REPLACE:				Command_REPLACE( (HWND)lparam1 );break;			//置換実行 @@@ 2002.2.2 YAZAKI
	case F_REPLACE_ALL:			Command_REPLACE_ALL();break;		//すべて置換実行(通常) 2002.2.8 hor 2006.04.02 かろと
	case F_SEARCH_CLEARMARK:	Command_SEARCH_CLEARMARK();break;	//検索マークのクリア
	case F_GREP_DIALOG:	//Grepダイアログの表示
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_GREP_DIALOG();
		return bRet;
	case F_GREP:			Command_GREP();break;							//Grep
	case F_GREP_REPLACE_DLG:	//Grep置換ダイアログの表示
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_GREP_REPLACE_DLG();
		return bRet;
	case F_GREP_REPLACE:	Command_GREP_REPLACE();break;							//Grep置換
	case F_JUMP_DIALOG:		Command_JUMP_DIALOG();break;					//指定行ヘジャンプダイアログの表示
	case F_JUMP:			Command_JUMP();break;							//指定行ヘジャンプ
	case F_OUTLINE:			bRet = Command_FUNCLIST( (int)lparam1, OUTLINE_DEFAULT );break;	//アウトライン解析
	case F_OUTLINE_TOGGLE:	bRet = Command_FUNCLIST( SHOW_TOGGLE, OUTLINE_DEFAULT );break;	//アウトライン解析(toggle) // 20060201 aroka
	case F_FILETREE:		bRet = Command_FUNCLIST( (BOOL)lparam1 ,OUTLINE_FILETREE );break;	//ファイルツリー
	case F_TAGJUMP:			Command_TAGJUMP(lparam1 != 0);break;			/* タグジャンプ機能 */ //	Apr. 03, 2003 genta 引数追加
	case F_TAGJUMP_CLOSE:	Command_TAGJUMP(true);break;					/* タグジャンプ(元ウィンドウClose) *///	Apr. 03, 2003 genta
	case F_TAGJUMPBACK:		Command_TAGJUMPBACK();break;					/* タグジャンプバック機能 */
	case F_TAGS_MAKE:		Command_TagsMake();break;						//タグファイルの作成	//@@@ 2003.04.13 MIK
	case F_DIRECT_TAGJUMP:	Command_TagJumpByTagsFileMsg( true );break;				/* ダイレクトタグジャンプ機能 */	//@@@ 2003.04.15 MIK
	case F_TAGJUMP_KEYWORD:	Command_TagJumpByTagsFileKeyword( (const wchar_t*)lparam1 );break;	/* @@ 2005.03.31 MIK キーワードを指定してダイレクトタグジャンプ機能 */
	case F_COMPARE:			Command_COMPARE();break;						/* ファイル内容比較 */
	case F_DIFF_DIALOG:		Command_Diff_Dialog();break;					/* DIFF差分表示(ダイアログ) */	//@@@ 2002.05.25 MIK
	case F_DIFF:			Command_Diff( (const WCHAR*)lparam1, (int)lparam2 );break;		/* DIFF差分表示 */	//@@@ 2002.05.25 MIK	// 2005.10.03 maru
	case F_DIFF_NEXT:		Command_Diff_Next();break;						/* DIFF差分表示(次へ) */		//@@@ 2002.05.25 MIK
	case F_DIFF_PREV:		Command_Diff_Prev();break;						/* DIFF差分表示(前へ) */		//@@@ 2002.05.25 MIK
	case F_DIFF_RESET:		Command_Diff_Reset();break;						/* DIFF差分表示(全解除) */		//@@@ 2002.05.25 MIK
	case F_BRACKETPAIR:		Command_BRACKETPAIR();	break;					//対括弧の検索
// From Here 2001.12.03 hor
	case F_BOOKMARK_SET:	Command_BOOKMARK_SET();break;					/* ブックマーク設定・解除 */
	case F_BOOKMARK_NEXT:	Command_BOOKMARK_NEXT();break;					/* 次のブックマークへ */
	case F_BOOKMARK_PREV:	Command_BOOKMARK_PREV();break;					/* 前のブックマークへ */
	case F_BOOKMARK_RESET:	Command_BOOKMARK_RESET();break;					/* ブックマークの全解除 */
	case F_BOOKMARK_VIEW:	bRet = Command_FUNCLIST( (BOOL)lparam1 ,OUTLINE_BOOKMARK );break;	//アウトライン解析
// To Here 2001.12.03 hor
	case F_BOOKMARK_PATTERN:Command_BOOKMARK_PATTERN();break;				// 2002.01.16 hor 指定パターンに一致する行をマーク
	case F_JUMP_SRCHSTARTPOS:	Command_JUMP_SRCHSTARTPOS();break;			// 検索開始位置へ戻る 02/06/26 ai
	case F_FUNCLIST_NEXT:	Command_FUNCLIST_NEXT();break;					// 次の関数リストマーク	2014.01.05
	case F_FUNCLIST_PREV:	Command_FUNCLIST_PREV();break;					// 前の関数リストマーク	2014.01.05


	/* モード切り替え系 */
	case F_CHGMOD_INS:		Command_CHGMOD_INS();break;		//挿入/上書きモード切り替え
	case F_CHG_CHARSET:		Command_CHG_CHARSET( (ECodeType)lparam1, lparam2 != 0 );break;	//文字コードセット指定	2010/6/14 Uchi
	// From Here 2003.06.23 Moca
	// F_CHGMOD_EOL_xxx はマクロに記録されないが、F_CHGMOD_EOLはマクロに記録されるので、マクロ関数を統合できるという手はず
	case F_CHGMOD_EOL_CRLF:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_CRLF, 0, 0, 0 );break;	//入力する改行コードをCRLFに設定
	case F_CHGMOD_EOL_LF:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_LF, 0, 0, 0 );break;	//入力する改行コードをLFに設定
	case F_CHGMOD_EOL_CR:	HandleCommand( F_CHGMOD_EOL, bRedraw, EOL_CR, 0, 0, 0 );break;	//入力する改行コードをCRに設定
	// 2006.09.03 Moca F_CHGMOD_EOLで break 忘れの修正
	case F_CHGMOD_EOL:		Command_CHGMOD_EOL( (EEolType)lparam1 );break;	//入力する改行コードを設定
	// To Here 2003.06.23 Moca
	case F_CANCEL_MODE:		Command_CANCEL_MODE();break;	//各種モードの取り消し

	/* 設定系 */
	case F_SHOWTOOLBAR:		Command_SHOWTOOLBAR();break;	/* ツールバーの表示/非表示 */
	case F_SHOWFUNCKEY:		Command_SHOWFUNCKEY();break;	/* ファンクションキーの表示/非表示 */
	case F_SHOWTAB:			Command_SHOWTAB();break;		/* タブの表示/非表示 */	//@@@ 2003.06.10 MIK
	case F_SHOWSTATUSBAR:	Command_SHOWSTATUSBAR();break;	/* ステータスバーの表示/非表示 */
	case F_SHOWMINIMAP:		Command_SHOWMINIMAP();break;	// ミニマップの表示/非表示
	case F_TYPE_LIST:		Command_TYPE_LIST();break;		/* タイプ別設定一覧 */
	case F_CHANGETYPE:		Command_CHANGETYPE((int)lparam1);break;		// タイプ別設定一時適用
	case F_OPTION_TYPE:		Command_OPTION_TYPE();break;	/* タイプ別設定 */
	case F_OPTION:			Command_OPTION();break;			/* 共通設定 */
	case F_FONT:			Command_FONT();break;			/* フォント設定 */
	case F_SETFONTSIZE:		Command_SETFONTSIZE((int)lparam1, (int)lparam2, (int)lparam3);break;	/* フォントサイズ設定 */
	case F_SETFONTSIZEUP:	HandleCommand( F_SETFONTSIZE, bRedraw, 0, 1, 2, 0);break;	/* フォントサイズ拡大 */
	case F_SETFONTSIZEDOWN:	HandleCommand( F_SETFONTSIZE, bRedraw, 0, -1, 2, 0);break;	/* フォントサイズ縮小 */
	case F_WRAPWINDOWWIDTH:	Command_WRAPWINDOWWIDTH();break;/* 現在のウィンドウ幅で折り返し */	//Oct. 7, 2000 JEPRO WRAPWINDIWWIDTH を WRAPWINDOWWIDTH に変更
	case F_FAVORITE:		Command_Favorite();break;		//履歴の管理	//@@@ 2003.04.08 MIK
	//	Jan. 29, 2005 genta 引用符の設定
	case F_SET_QUOTESTRING:	Command_SET_QUOTESTRING((const WCHAR*)lparam1);	break;
	case F_TMPWRAPNOWRAP:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_NO_TEXT_WRAP, 0, 0, 0 );break;	// 折り返さない(一時設定)			// 2008.05.30 nasukoji
	case F_TMPWRAPSETTING:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_SETTING_WIDTH, 0, 0, 0 );break;	// 指定桁で折り返す(一時設定)		// 2008.05.30 nasukoji
	case F_TMPWRAPWINDOW:	HandleCommand( F_TEXTWRAPMETHOD, bRedraw, WRAP_WINDOW_WIDTH, 0, 0, 0 );break;	// 右端で折り返す(一時設定)		// 2008.05.30 nasukoji
	case F_TEXTWRAPMETHOD:	Command_TEXTWRAPMETHOD( (int)lparam1 );break;		// テキストの折り返し方法		// 2008.05.30 nasukoji
	case F_SELECT_COUNT_MODE:	Command_SELECT_COUNT_MODE( (int)lparam1 );break;	// 文字カウントの方法		// 2009.07.06 syat

	/* マクロ系 */
	case F_RECKEYMACRO:		Command_RECKEYMACRO();break;	/* キーマクロの記録開始/終了 */
	case F_SAVEKEYMACRO:	Command_SAVEKEYMACRO();break;	/* キーマクロの保存 */
	case F_LOADKEYMACRO:	Command_LOADKEYMACRO();break;	/* キーマクロの読み込み */
	case F_EXECKEYMACRO:									/* キーマクロの実行 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_EXECKEYMACRO(); return bRet;
	case F_EXECEXTMACRO:
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		/* 名前を指定してマクロ実行 */
		Command_EXECEXTMACRO( (const WCHAR*)lparam1, (const WCHAR*)lparam2 );
		return bRet;
	//	From Here Sept. 20, 2000 JEPRO 名称CMMANDをCOMMANDに変更
	//	case F_EXECCMMAND:		Command_EXECCMMAND();break;	/* 外部コマンド実行 */
	case F_EXECMD_DIALOG:
		//Command_EXECCOMMAND_DIALOG((const char*)lparam1);	/* 外部コマンド実行 */
		Command_EXECCOMMAND_DIALOG();	/* 外部コマンド実行 */	//	引数つかってないみたいなので
		break;
	//	To Here Sept. 20, 2000
	case F_EXECMD:
		//Command_EXECCOMMAND((const char*)lparam1);
		Command_EXECCOMMAND((LPCWSTR)lparam1, (int)lparam2, (LPCWSTR)lparam3);	//	2006.12.03 maru 引数の拡張のため
		break;

	/* カスタムメニュー */
	case F_MENU_RBUTTON:	/* 右クリックメニュー */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_MENU_RBUTTON();
		return bRet;
	case F_CUSTMENU_1:  /* カスタムメニュー1 */
	case F_CUSTMENU_2:  /* カスタムメニュー2 */
	case F_CUSTMENU_3:  /* カスタムメニュー3 */
	case F_CUSTMENU_4:  /* カスタムメニュー4 */
	case F_CUSTMENU_5:  /* カスタムメニュー5 */
	case F_CUSTMENU_6:  /* カスタムメニュー6 */
	case F_CUSTMENU_7:  /* カスタムメニュー7 */
	case F_CUSTMENU_8:  /* カスタムメニュー8 */
	case F_CUSTMENU_9:  /* カスタムメニュー9 */
	case F_CUSTMENU_10: /* カスタムメニュー10 */
	case F_CUSTMENU_11: /* カスタムメニュー11 */
	case F_CUSTMENU_12: /* カスタムメニュー12 */
	case F_CUSTMENU_13: /* カスタムメニュー13 */
	case F_CUSTMENU_14: /* カスタムメニュー14 */
	case F_CUSTMENU_15: /* カスタムメニュー15 */
	case F_CUSTMENU_16: /* カスタムメニュー16 */
	case F_CUSTMENU_17: /* カスタムメニュー17 */
	case F_CUSTMENU_18: /* カスタムメニュー18 */
	case F_CUSTMENU_19: /* カスタムメニュー19 */
	case F_CUSTMENU_20: /* カスタムメニュー20 */
	case F_CUSTMENU_21: /* カスタムメニュー21 */
	case F_CUSTMENU_22: /* カスタムメニュー22 */
	case F_CUSTMENU_23: /* カスタムメニュー23 */
	case F_CUSTMENU_24: /* カスタムメニュー24 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		nFuncID = Command_CUSTMENU( nCommand - F_CUSTMENU_1 + 1 );
		if( 0 != nFuncID ){
			/* コマンドコードによる処理振り分け */
//			HandleCommand( nFuncID, true, 0, 0, 0, 0 );
			::PostMessageCmd( GetMainWindow(), WM_COMMAND, MAKELONG( nFuncID, 0 ), (LPARAM)NULL );
		}
		return bRet;

	/* ウィンドウ系 */
	case F_SPLIT_V:			Command_SPLIT_V();break;	/* 上下に分割 */	//Sept. 17, 2000 jepro 説明の「縦」を「上下に」に変更
	case F_SPLIT_H:			Command_SPLIT_H();break;	/* 左右に分割 */	//Sept. 17, 2000 jepro 説明の「横」を「左右に」に変更
	case F_SPLIT_VH:		Command_SPLIT_VH();break;	/* 縦横に分割 */	//Sept. 17, 2000 jepro 説明に「に」を追加
	case F_WINCLOSE:		Command_WINCLOSE();break;	//ウィンドウを閉じる
	case F_WIN_CLOSEALL:	/* すべてのウィンドウを閉じる */	//Oct. 7, 2000 jepro 「編集ウィンドウの全終了」を左記のように変更
		//Oct. 17, 2000 JEPRO 名前を変更(F_FILECLOSEALL→F_WIN_CLOSEALL)
		Command_FILECLOSEALL();
		break;
	case F_BIND_WINDOW:		Command_BIND_WINDOW();break;	//結合して表示 2004.07.14 Kazika 新規追加
	case F_CASCADE:			Command_CASCADE();break;		//重ねて表示
	case F_TILE_V:			Command_TILE_V();break;			//上下に並べて表示
	case F_TILE_H:			Command_TILE_H();break;			//左右に並べて表示
	case F_MAXIMIZE_V:		Command_MAXIMIZE_V();break;		//縦方向に最大化
	case F_MAXIMIZE_H:		Command_MAXIMIZE_H();break;		//横方向に最大化 //2001.02.10 by MIK
	case F_MINIMIZE_ALL:	Command_MINIMIZE_ALL();break;	/* すべて最小化 */	//	Sept. 17, 2000 jepro 説明の「全て」を「すべて」に統一
	case F_REDRAW:			Command_REDRAW();break;			/* 再描画 */
	case F_WIN_OUTPUT:		Command_WIN_OUTPUT();break;		//アウトプットウィンドウ表示
	case F_TRACEOUT:		Command_TRACEOUT((const wchar_t*)lparam1, (int)lparam2, (int)lparam3);break;		//マクロ用アウトプットウィンドウに表示 maru 2006.04.26
	case F_TOPMOST:			Command_WINTOPMOST( lparam1 );break;	//常に手前に表示 Moca
	case F_WINLIST:			Command_WINLIST( nCommandFrom );break;		/* ウィンドウ一覧ポップアップ表示処理 */	// 2006.03.23 fon // 2006.05.19 genta 引数追加
	case F_DLGWINLIST:		Command_DLGWINLIST();break;		// ウィンドウ一覧表示
	case F_GROUPCLOSE:		Command_GROUPCLOSE();break;		/* グループを閉じる */		// 2007.06.20 ryoji 追加
	case F_NEXTGROUP:		Command_NEXTGROUP();break;		/* 次のグループ */			// 2007.06.20 ryoji 追加
	case F_PREVGROUP:		Command_PREVGROUP();break;		/* 前のグループ */			// 2007.06.20 ryoji 追加
	case F_TAB_MOVERIGHT:	Command_TAB_MOVERIGHT();break;	/* タブを右に移動 */		// 2007.06.20 ryoji 追加
	case F_TAB_MOVELEFT:	Command_TAB_MOVELEFT();break;	/* タブを左に移動 */		// 2007.06.20 ryoji 追加
	case F_TAB_SEPARATE:	Command_TAB_SEPARATE();break;	/* 新規グループ */			// 2007.06.20 ryoji 追加
	case F_TAB_JOINTNEXT:	Command_TAB_JOINTNEXT();break;	/* 次のグループに移動 */	// 2007.06.20 ryoji 追加
	case F_TAB_JOINTPREV:	Command_TAB_JOINTPREV();break;	/* 前のグループに移動 */	// 2007.06.20 ryoji 追加
	case F_TAB_CLOSEOTHER:	Command_TAB_CLOSEOTHER();break;	/* このタブ以外を閉じる */	// 2008.11.22 syat 追加
	case F_TAB_CLOSELEFT:	Command_TAB_CLOSELEFT();break;	/* 左をすべて閉じる */		// 2008.11.22 syat 追加
	case F_TAB_CLOSERIGHT:	Command_TAB_CLOSERIGHT();break;	/* 右をすべて閉じる */		// 2008.11.22 syat 追加

	/* 支援 */
	case F_HOKAN:			Command_HOKAN();break;			//入力補完
	case F_HELP_CONTENTS:	Command_HELP_CONTENTS();break;	/* ヘルプ目次 */				//Nov. 25, 2000 JEPRO 追加
	case F_HELP_SEARCH:		Command_HELP_SEARCH();break;	/* ヘルプトキーワード検索 */	//Nov. 25, 2000 JEPRO 追加
	case F_TOGGLE_KEY_SEARCH:	Command_ToggleKeySearch((int)lparam1);break;	/* キャレット位置の単語を辞書検索する機能ON-OFF */	// 2006.03.24 fon
	case F_MENU_ALLFUNC:									/* コマンド一覧 */
		/* 再帰処理対策 */
		m_pCommanderView->SetUndoBuffer( true );
		Command_MENU_ALLFUNC();return bRet;
	case F_EXTHELP1:	Command_EXTHELP1();break;		/* 外部ヘルプ1 */
	case F_EXTHTMLHELP:	/* 外部HTMLヘルプ */
		//	Jul. 5, 2002 genta
		Command_EXTHTMLHELP( (const WCHAR*)lparam1, (const WCHAR*)lparam2 );
		break;
	case F_ABOUT:	Command_ABOUT();break;				/* バージョン情報 */	//Dec. 24, 2000 JEPRO 追加

	/* その他 */

	case F_0: break; // F_0でプラグインが実行されるバグ対策	// ← rev1886 の問題は呼び元で対策したが安全弁として残す

	default:
		//プラグインコマンドを実行する
		{
			m_pCommanderView->SetUndoBuffer( true ); // 2013.05.01 追加。再帰対応

			CPlug::Array plugs;
			CJackManager::getInstance()->GetUsablePlug( PP_COMMAND, nCommand, &plugs );

			if( plugs.size() > 0 ){
				assert_warning( 1 == plugs.size() );
				//インタフェースオブジェクト準備
				CWSHIfObj::List params;
				//プラグイン呼び出し
				( *plugs.begin() )->Invoke( m_pCommanderView, params );

				return bRet;
			}
		}

	}

	/* アンドゥバッファの処理 */
	m_pCommanderView->SetUndoBuffer( true );

	return bRet;
}
const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
{
	TiXmlDocument* document = GetDocument();

	const char* pWithWhiteSpace = p;
	// Read in text and elements in any order.
	p = SkipWhiteSpace( p, encoding );
	while ( p && *p )
	{
		if ( *p != '<' )
		{
			// Take what we have, make a text element.
			TiXmlText* textNode = new TiXmlText( "" );

			if ( !textNode )
			{
				if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, encoding );
				    return 0;
			}

			if ( TiXmlBase::IsWhiteSpaceCondensed() )
			{
				p = textNode->Parse( p, data, encoding );
			}
			else
			{
				// Special case: we want to keep the white space
				// so that leading spaces aren't removed.
				p = textNode->Parse( pWithWhiteSpace, data, encoding );
			}

			if ( !textNode->Blank() )
				LinkEndChild( textNode );
			else
				delete textNode;
		} 
		else 
		{
			// We hit a '<'
			// Have we hit a new element or an end tag?
			if ( StringEqual( p, "</", false, encoding ) )
			{
				return p;
			}
			else
			{
				TiXmlNode* node = Identify( p, encoding );
				if ( node )
				{
					p = node->Parse( p, data, encoding );
					LinkEndChild( node );
				}				
				else
				{
					return 0;
				}
			}
		}
		p = SkipWhiteSpace( p, encoding );
	}

	if ( !p )
	{
		if ( document ) document->SetError( TIXML_ERROR_READING_ELEMENT_VALUE, 0, 0, encoding );
	}	
	return p;
}
Beispiel #26
0
void CBusToBusView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
}
void TiXmlElement::StreamIn (TIXML_ISTREAM * in, TIXML_STRING * tag)
{
	// We're called with some amount of pre-parsing. That is, some of "this"
	// element is in "tag". Go ahead and stream to the closing ">"
	while( in->good() )
	{
		int c = in->get();
		if ( c <= 0 )
		{
			TiXmlDocument* document = GetDocument();
			if ( document )
				document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
			return;
		}
		(*tag) += (char) c ;
		
		if ( c == '>' )
			break;
	}

	if ( tag->length() < 3 ) return;

	// Okay...if we are a "/>" tag, then we're done. We've read a complete tag.
	// If not, identify and stream.

	if (    tag->at( tag->length() - 1 ) == '>' 
		 && tag->at( tag->length() - 2 ) == '/' )
	{
		// All good!
		return;
	}
	else if ( tag->at( tag->length() - 1 ) == '>' )
	{
		// There is more. Could be:
		//		text
		//		closing tag
		//		another node.
		for ( ;; )
		{
			StreamWhiteSpace( in, tag );

			// Do we have text?
			if ( in->good() && in->peek() != '<' ) 
			{
				// Yep, text.
				TiXmlText text( "" );
				text.StreamIn( in, tag );

				// What follows text is a closing tag or another node.
				// Go around again and figure it out.
				continue;
			}

			// We now have either a closing tag...or another node.
			// We should be at a "<", regardless.
			if ( !in->good() ) return;
			assert( in->peek() == '<' );
			int tagIndex = tag->length();

			bool closingTag = false;
			bool firstCharFound = false;

			for( ;; )
			{
				if ( !in->good() )
					return;

				int c = in->peek();
				if ( c <= 0 )
				{
					TiXmlDocument* document = GetDocument();
					if ( document )
						document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
					return;
				}
				
				if ( c == '>' )
					break;

				*tag += (char) c;
				in->get();

				if ( !firstCharFound && c != '<' && !IsWhiteSpace( c ) )
				{
					firstCharFound = true;
					if ( c == '/' )
						closingTag = true;
				}
			}
			// If it was a closing tag, then read in the closing '>' to clean up the input stream.
			// If it was not, the streaming will be done by the tag.
			if ( closingTag )
			{
				if ( !in->good() )
					return;

				int c = in->get();
				if ( c <= 0 )
				{
					TiXmlDocument* document = GetDocument();
					if ( document )
						document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
					return;
				}
				assert( c == '>' );
				*tag += (char) c;

				// We are done, once we've found our closing tag.
				return;
			}
			else
			{
				// If not a closing tag, id it, and stream.
				const char* tagloc = tag->c_str() + tagIndex;
				TiXmlNode* node = Identify( tagloc, TIXML_DEFAULT_ENCODING );
				if ( !node )
					return;
				node->StreamIn( in, tag );
				delete node;
				node = 0;

				// No return: go around from the beginning: text, closing tag, or node.
			}
		}
	}
}
Beispiel #28
0
/**
	@brief	

	@author	HumKyung

	@date	2010.12.23

	@param

	@return
*/
void CBusToBusView::OnInitialUpdate()
{
	CView::OnInitialUpdate();

	CRect rect;
	rect.SetRectEmpty();
	if(NULL == m_wndGridCtrl.GetSafeHwnd())
	{
		if(TRUE == m_wndGridCtrl.Create(rect , this , 0x101))
		{
			m_wndGridCtrl.SetFixedRowCount(1);
			m_wndGridCtrl.SetColumnCount(3);

			m_wndGridCtrl.SetItemText(0 , 0 , _T(""));
			m_wndGridCtrl.SetItemText(0 , 1 , _T("From"));
			m_wndGridCtrl.SetItemText(0 , 2 , _T("To"));

			CELoadDocData& docData = CELoadDocData::GetInstance();
			CBusToBusDoc* pDoc = (CBusToBusDoc*)GetDocument();
			/// create bus to bus relations
			list<CELoadItem*> TransformerItemList;
			docData.GetELoadItemListOf(TransformerItemList , CTransformerItem::TypeString());
			for(list<CELoadItem*>::iterator itr = TransformerItemList.begin();itr != TransformerItemList.end();++itr)
			{
				CTransformerItem* pTrItem = static_cast<CTransformerItem*>(*itr);
				if(0 == pTrItem->GetName().find(_T("DEL ")))
				{
					m_wndGridCtrl.SetRowCount( m_wndGridCtrl.GetRowCount() + 1 );
					const int iRow = m_wndGridCtrl.GetRowCount() - 1;
	
					m_wndGridCtrl.SetCellType(iRow , 0 , RUNTIME_CLASS(CGridCellCheck));

					///CBusEntity *pFromBusEnt = NULL , *pToBusEnt = NULL;
					const string sFromBusName = pTrItem->prop()->GetValue(_T("From") , _T("Bus Id"));
					m_wndGridCtrl.SetItemText(iRow , 1 , sFromBusName.c_str());
					m_wndGridCtrl.SetCellType(iRow , 1 , RUNTIME_CLASS(CGridCellBusCombo));
					CGridCellBusCombo* pCell = (CGridCellBusCombo*)(m_wndGridCtrl.GetCell(iRow , 1));
					if(pCell) pCell->SetStyle(CBS_DROPDOWNLIST);
					
					const string sToBusName   = pTrItem->prop()->GetValue(_T("To") , _T("Bus Id"));
					m_wndGridCtrl.SetItemText(iRow , 2 , sToBusName.c_str());
					m_wndGridCtrl.SetCellType(iRow , 2 , RUNTIME_CLASS(CGridCellBusCombo));
					pCell = (CGridCellBusCombo*)(m_wndGridCtrl.GetCell(iRow , 2));
					if(pCell) pCell->SetStyle(CBS_DROPDOWNLIST);

					m_wndGridCtrl.SetItemData(iRow , 0 , LPARAM(pTrItem));
				}
			}

			m_wndGridCtrl.AutoSize();
			m_wndGridCtrl.SetColumnWidth(0 , 30);
			m_wndGridCtrl.SetColumnWidth(1 , 120);
			m_wndGridCtrl.SetColumnWidth(2 , 120);
		}
	}

	if(NULL == m_wndAddButton.GetSafeHwnd())
	{
		if(TRUE == m_wndAddButton.Create(_T("Add") , WS_CHILD | WS_VISIBLE , rect , this , 0x102)){}
	}

	if(NULL == m_wndDeleteButton.GetSafeHwnd())
	{
		if(TRUE == m_wndDeleteButton.Create(_T("Delete") , WS_CHILD | WS_VISIBLE , rect , this , 0x103)){}
	}

	if(NULL == m_wndSaveButton.GetSafeHwnd())
	{
		if(TRUE == m_wndSaveButton.Create(_T("Save") , WS_CHILD | WS_VISIBLE , rect , this , ID_TOOL_SAVE_BUS_TO_BUS_RELATION))
		{
			m_wndSaveButton.SetIcon(IDI_SAVE);
		}
	}
}
/*!	@brief 折り返しの動作を決定

	トグルコマンド「現在のウィンドウ幅で折り返し」を行った場合の動作を決定する
	
	@retval TGWRAP_NONE No action
	@retval TGWRAP_FULL 最大値
	@retval TGWRAP_WINDOW ウィンドウ幅
	@retval TGWRAP_PROP 設定値

	@date 2006.01.08 genta メニュー表示で同一の判定を使うため,Command_WRAPWINDOWWIDTH()より分離.
	@date 2006.01.08 genta 判定条件を見直し
	@date 2008.06.08 ryoji ウィンドウ幅設定にぶら下げ余白を追加
*/
CEditView::TOGGLE_WRAP_ACTION CEditView::GetWrapMode( CKetaXInt* _newKetas )
{
	CKetaXInt& newKetas=*_newKetas;
	//@@@ 2002.01.14 YAZAKI 現在のウィンドウ幅で折り返されているときは、最大値にするコマンド。
	//2002/04/08 YAZAKI ときどきウィンドウ幅で折り返されないことがあるバグ修正。
	// 20051022 aroka 現在のウィンドウ幅→最大値→文書タイプの初期値 をトグルにするコマンド
	// ウィンドウ幅==文書タイプ||最大値==文書タイプ の場合があるため判定順序に注意する。
	/*	Jan.  8, 2006 genta
		じゅうじさんの要望により判定方法を再考.現在の幅に合わせるのを最優先に.
	
		基本動作: 設定値→ウィンドウ幅
			→(ウィンドウ幅と合っていなければ)→ウィンドウ幅→上へ戻る
			→(ウィンドウ幅と合っていたら)→最大値→設定値
			ただし,最大値==設定値の場合には最大値→設定値の遷移が省略されて上に戻る
			
			ウィンドウ幅が極端に狭い場合にはウィンドウ幅に合わせることは出来ないが,
			設定値と最大値のトグルは可能.

		0)現在のテキストの折り返し方法!=指定桁で折り返す:変更不能
		1)現在の折り返し幅==ウィンドウ幅 : 最大値
		2)現在の折り返し幅!=ウィンドウ幅
		3)→ウィンドウ幅が極端に狭い場合
		4) └→折り返し幅!=最大値 : 最大値
		5) └→折り返し幅==最大値
		6)   └→最大値==設定値 : 変更不能
		7)   └→最大値!=設定値 : 設定値
		8)→ウィンドウ幅が十分にある
		9) └→折り返し幅==最大値
		a)   └→最大値!=設定値 : 設定値
	 	b)   └→最大値==設定値 : ウィンドウ幅
		c) └→ウィンドウ幅
	*/
	
	if (GetDocument()->m_cLayoutMgr.GetMaxLineKetas() == ViewColNumToWrapColNum( GetTextArea().m_nViewColNum ) ){
		// a)
		newKetas = CKetaXInt(MAXLINEKETAS);
		return TGWRAP_FULL;
	}
	else if( MINLINEKETAS > GetTextArea().m_nViewColNum - GetWrapOverhang() ){ // 2)
		// 3)
		if( GetDocument()->m_cLayoutMgr.GetMaxLineKetas() != MAXLINEKETAS ){
			// 4)
			newKetas = CKetaXInt(MAXLINEKETAS);
			return TGWRAP_FULL;
		}
		else if( m_pTypeData->m_nMaxLineKetas == MAXLINEKETAS ){ // 5)
			// 6)
			return TGWRAP_NONE;
		}
		else { // 7)
			newKetas = m_pTypeData->m_nMaxLineKetas;
			return TGWRAP_PROP;
		}
	}
	else { // 8)
		if( GetDocument()->m_cLayoutMgr.GetMaxLineKetas() == MAXLINEKETAS && // 9)
			m_pTypeData->m_nMaxLineKetas != MAXLINEKETAS ){
			// a)
			newKetas = m_pTypeData->m_nMaxLineKetas;
			return TGWRAP_PROP;
			
		}
		else {	// b) c)
			//	現在のウィンドウ幅
			newKetas = ViewColNumToWrapColNum( GetTextArea().m_nViewColNum );
			return TGWRAP_WINDOW;
		}
	}
}
Beispiel #30
0
/// Item help update
void ctConfigToolView::OnUpdateItemHelp(wxUpdateUIEvent& event)
{
    ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
    event.Enable( doc && GetSelection() );
}