Esempio n. 1
0
PluginSettings::PluginSettings(const GUID& Guid, bool Local):
	PluginsCfg(nullptr)
{
	const auto pPlugin = Global->CtrlObject->Plugins->FindPlugin(Guid);
	if (pPlugin)
	{
		string strGuid = GuidToStr(Guid);
		PluginsCfg = ConfigProvider().CreatePluginsConfig(strGuid, Local);
		m_Keys.emplace_back(PluginsCfg->CreateKey(HierarchicalConfig::root_key(), strGuid, &pPlugin->GetTitle()));

		if (!Global->Opt->ReadOnlyConfig)
		{
			DizList Diz;
			string strDbPath = Local ? Global->Opt->LocalProfilePath : Global->Opt->ProfilePath;
			AddEndSlash(strDbPath);
			strDbPath += L"PluginsData\\";
			Diz.Read(strDbPath);
			string strDbName = strGuid + L".db";
			string Description = string(pPlugin->GetTitle()) + L" (" + pPlugin->GetDescription() + L")";
			if(Description != NullToEmpty(Diz.GetDizTextAddr(strDbName, L"", 0)))
			{
				Diz.AddDizText(strDbName, L"", Description);
				Diz.Flush(strDbPath);
			}
		}
	}
}
Esempio n. 2
0
void CDBFExplorerDoc::OnFileExport() 
{
 	static TCHAR szFilters[] = _T("Text Files (*.txt;*.csv)|*.txt;*.csv|HTML Files (*.html;*.htm)|*.html;*.htm||");
	
	CString strFileName = GetTitle();
	int nPos = strFileName.ReverseFind('.');
	if (nPos != -1)
		strFileName = strFileName.Left(nPos);
	
	CExportFileDialog dlg(FALSE, NULL, strFileName, OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY, szFilters, GetActiveFrame());

	dlg.m_ofn.lpstrTitle = _T("Export database");

	if (dlg.DoModal() == IDOK)
	{
		strFileName = dlg.GetPathName();
		CString strExtension = dlg.GetFileExt();
		if (dlg.m_strType == _T("Text Files (*.txt;*.csv)"))
		{
			if (strExtension.IsEmpty())
				strFileName += _T(".txt");

			ExportToText(strFileName);
		}
		else
		if (dlg.m_strType == _T("HTML Files (*.html;*.htm)"))
		{
			if (strExtension.IsEmpty())
				strFileName += _T(".html");

			ExportToHTML(strFileName);
		}
	}	
}
Esempio n. 3
0
ExportMultiple::ExportMultiple(AudacityProject *project)
: wxDialogWrapper(project, wxID_ANY, wxString(_("Export Multiple")))
{
   SetName(GetTitle());

   mProject = project;
   mTracks = project->GetTracks();
   // Construct an array of non-owning pointers
   for (const auto &plugin : mExporter.GetPlugins())
      mPlugins.push_back(plugin.get());

   this->CountTracksAndLabels();

   mBook = NULL;

   ShuttleGui S(this, eIsCreatingFromPrefs);

   // Creating some of the widgets cause events to fire
   // and we don't want that until after we're completely
   // created.  (Observed on Windows)
   mInitialized = false;
   PopulateOrExchange(S);
   mInitialized = true;

   Layout();
   Fit();
   SetMinSize(GetSize());
   Center();

   EnableControls();
}
CString CDiagramRadiobutton::Export( UINT /*format*/ )
/* ============================================================
	Function :		CDiagramRadiobutton::Export
	Description :	Exports this object to str using format
					
	Return :		CString		-	The resulting string
	Parameters :	UINT format	-	The format to export to
					
	Usage :			An example Export-function. In this case, 
					we are not using the format parameter, as 
					we only have one format.

   ============================================================*/
{
	return "";

	CString input( "\t<div class='controls' style='position:absolute;left:%i;top:%i;width:%i;height:%i;'><input onfocus='blur()' onclick='JavaScript:radiobuttonHandler(this)' type=radio name='%s'>%s</input></div>" );
	CString str;
	CRect rect = GetRect();
	CString title = GetTitle();
	title.Replace( " ", "&nbsp;" );
	str.Format( input, rect.left - 2, rect.top - 2, rect.Width(), rect.Height(), GetName(), title );

	return str;
}
Esempio n. 5
0
String HelpTopicInfo::GetTitle() const
{
	String t = GetTitle(GetCurrentLanguage());
	if(IsNull(t))
		t = GetDefaultTitle();
	return t;
}
Esempio n. 6
0
void FbAuthorReplaceDlg::EndModal(int retCode)
{
	if ( retCode == wxID_OK) {
		int author = GetSelected();
		if (author) {
			wxString msg = _("Merge authors?");
			wxString title = GetTitle() + wxT("...");
			bool ok = wxMessageBox(msg, title, wxOK | wxCANCEL | wxICON_QUESTION) == wxOK;
			if (!ok) return;
		} else {
			wxMessageBox(_("Author not selected by replacement."), GetTitle());
			return;
		}
	}
	FbDialog::EndModal(retCode);
}
Esempio n. 7
0
void VAutoDialog::OnMove(wxCommandEvent& ev)
{
	wxString mbTitle = _("Moving telescope");
	wxLogDebug (wxT("VAutoDialog::OnMove starts telescope moving."));

	// Check whether target is valid
	if (!m_CurrentTarget.IsValid()) {
		wxMessageBox (_("No valid target is selected to move."), mbTitle, wxICON_EXCLAMATION | wxOK, this);
		return;
		}

	// Check whether the target is above the horizon
//	double lon = wxAtof (Properties::Instance().Get(STATION_LONGITUDE));
//	double lat = wxAtof (Properties::Instance().Get(STATION_LATITUDE));
//	Station station (lon, lat);
//	if (!m_CurrentTarget.GetCoord().AboveHorizon(station, wxDateTime::Now().GetJulianDayNumber()))

	if (!IsTargetAboveHorizon (m_CurrentTarget))
	{
		wxMessageBox (_("The object currently is under the horizon"), GetTitle(), wxICON_EXCLAMATION | wxOK, this);
		return;
	}

	DoMove ();
}
Esempio n. 8
0
void CPpcMainWnd::SortFile(int nSort)
{
#define CURRENT_MASK	0x8000
	int i, nFocus = -1;
	FILEINFO* p;
	TCHAR szTitle[MAX_PATH];

	for (i = 0; i < m_pListFile->GetCount(); i++) {
		p = (FILEINFO*)m_pListFile->GetAt(i);
		p->dwUser = (i == m_nCurrent) ? CURRENT_MASK : 0;
		p->dwUser |= ListView_GetItemState(m_hwndLV, i, LVIS_FOCUSED | LVIS_SELECTED);
	}

	m_pListFile->Sort(SortCompareProc, nSort);
	for (i = 0; i < m_pListFile->GetCount(); i++) {
		p = (FILEINFO*)m_pListFile->GetAt(i);
		if (p->dwUser & CURRENT_MASK)
			m_nCurrent = i;
		GetTitle(i, szTitle);
		ListView_SetItemText(m_hwndLV, i, 0, szTitle);
		ListView_SetItemState(m_hwndLV, i, p->dwUser, LVIS_FOCUSED | LVIS_SELECTED);
		if (p->dwUser &LVIS_FOCUSED)
			nFocus = i;
	}
	if (nFocus != -1)
		ListView_EnsureVisible(m_hwndLV, nFocus, FALSE);

	UpdateTrack();
}
Esempio n. 9
0
BOOL CPpcMainWnd::InsertFile(LPTSTR pszFile, int nIndex)
{
	if (!m_hMap) return FALSE;

	// 有効性チェック
	if (!IsValidStream(pszFile))
		return FALSE;

	// リストに挿入
	FILEINFO* pInfo = new FILEINFO;
	MAP_GetId3TagFile(m_hMap, pszFile, &pInfo->tag);
	_tcscpy(pInfo->szPath, pszFile);
	m_pListFile->Insert((DWORD)pInfo, nIndex);

	// リストビューに追加
	TCHAR szTitle[MAX_PATH];
	GetTitle(m_pListFile->GetCount() - 1, szTitle);
	LVITEM lvi = {0};
	lvi.mask = LVIF_TEXT;
	lvi.iItem = nIndex;
	lvi.pszText = szTitle;
	ListView_InsertItem(m_hwndLV, &lvi);

	// 開いていない場合は開く
	OpenFirstFile();

	return TRUE;
}
Esempio n. 10
0
// リスト
BOOL CPpcMainWnd::AddFile(LPTSTR pszFile, LPTSTR pszTitle)
{
	if (!m_hMap) return FALSE;

	// 存在チェック
	if (IsExisting(pszFile))
		return FALSE;

	// 有効性チェック
	if (!IsValidStream(pszFile))
		return FALSE;

	// リストに追加
	FILEINFO* pInfo = new FILEINFO;
	if (pszTitle)
		_tcscpy(pInfo->szDisplayName, pszTitle);
	else 
		MAP_GetId3TagFile(m_hMap, pszFile, &pInfo->tag);
	_tcscpy(pInfo->szPath, pszFile);
	m_pListFile->Add((DWORD)pInfo);

	// リストビューに追加
	TCHAR szTitle[MAX_PATH];
	GetTitle(m_pListFile->GetCount() - 1, szTitle);
	LVITEM lvi = {0};
	lvi.mask = LVIF_TEXT;
	lvi.iItem = ListView_GetItemCount(m_hwndLV);
	lvi.pszText = szTitle;
	ListView_InsertItem(m_hwndLV, &lvi);

	// 開いていない場合は開く
	OpenFirstFile();

	return TRUE;
}
Esempio n. 11
0
void	CTitleManager::AddEarned(int nId)
{
	EarnedTitle Temp;
	Temp.nId		= nId;
	Temp.strTitle	= GetTitle(nId); 
	m_vecEarned.push_back(Temp);
}
void CDiagramRadiobutton::Draw( CDC* dc, CRect rect )
/* ============================================================
	Function :		CDiagramRadiobutton::Draw
	Description :	Draws the "control"
					
	Return :		void
	Parameters :	CDC* dc		-	CDC to draw to
					CRect rect	-	Total object rect (zoomed)
					
	Usage :			

   ============================================================*/
{

	dc->SelectObject( CStdGrfx::dialogBrush() );
	dc->SelectObject( CStdGrfx::dialogPen() );

	dc->Rectangle( rect );

	LOGFONT lf;
	CFont chk;
	CFont font;

	GetFont( lf );
	// MS Sans Serif will not scale below 8 pts
	if( GetZoom() < 1 )
		lstrcpy( lf.lfFaceName, _T( "Arial" ) );
	font.CreateFontIndirect( &lf );

	// Marlett is used for the circle
	chk.CreateFont(  ( int ) ( ( double ) lf.lfHeight * 1.25 ), 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_TT_ONLY_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DECORATIVE, "Marlett" );
	dc->SetBkMode( TRANSPARENT );
	dc->SelectObject( &chk );

	dc->SetTextColor( ::GetSysColor( COLOR_WINDOW ) );
	dc->TextOut( rect.left, rect.top, "n" );

	dc->SetTextColor( ::GetSysColor( COLOR_3DSHADOW ) );
	dc->TextOut( rect.left, rect.top, "j" );

	dc->SetTextColor( ::GetSysColor( COLOR_3DHIGHLIGHT  ) );
	dc->TextOut( rect.left, rect.top, "k" );

	dc->SetTextColor( ::GetSysColor( COLOR_3DDKSHADOW ) );
	dc->TextOut( rect.left, rect.top, "l" );

	dc->SetTextColor( ::GetSysColor( COLOR_3DLIGHT ) );
	dc->TextOut( rect.left, rect.top, "m" );

	dc->SelectObject( &font );

	dc->SetTextColor( ::GetSysColor( COLOR_BTNTEXT ) );
	rect.left += ( int ) ( ( double ) abs( lf.lfHeight ) * 1.5 );
	dc->DrawText( GetTitle(), rect, DT_SINGLELINE );

	dc->SelectStockObject( DEFAULT_GUI_FONT );
	dc->SelectStockObject( BLACK_PEN );
	dc->SelectStockObject( WHITE_BRUSH );

}
Esempio n. 13
0
void CdSqlQuery::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		CfSqlQueryFrame* pFrame = GetFrameWindow();
		if (!pFrame)
			return;
		ar << m_strNode;
		ar << m_strServer;
		ar << m_strUser;
		ar << m_strDatabase;
		ar << m_nDbFlag;

		ar << m_SeqNum;
		ar << m_nNodeHandle;
		ar << GetTitle();
		ar << m_IngresVersion;

		BOOL bToolBarVisible = FALSE;
		CToolBar* pTbar = GetToolBar();
		if (pTbar && IsWindowVisible(pTbar->m_hWnd))
			bToolBarVisible = TRUE;
		ar << bToolBarVisible;
		//
		// Full state of all toolbars in the frame
		pFrame->GetDockState(m_toolbarState);
		m_toolbarState.Serialize(ar);
		//
		// Frame window placement
		memset(&m_wplj, 0, sizeof(m_wplj));
		BOOL bResult = pFrame->GetWindowPlacement(&m_wplj);
		ASSERT (bResult);
		ar.Write(&m_wplj, sizeof(m_wplj));
	}
	else
	{
		CString strTitle;
		m_bLoaded = TRUE;
		ar >> m_strNode;
		ar >> m_strServer;
		ar >> m_strUser;
		ar >> m_strDatabase;
		ar >> m_nDbFlag;

		ar >> m_SeqNum;
		ar >> m_nNodeHandle;
		ar >> strTitle; SetTitle(strTitle);
		ar >> m_IngresVersion;

		ar >> m_bToolbarVisible;
		//
		// Full state of all toolbars in the frame
		m_toolbarState.Serialize(ar);
		//
		// Frame window placement
		ar.Read(&m_wplj, sizeof(m_wplj));
	}
	SerializeSqlControl(ar);
}
Esempio n. 14
0
int CShaderListBox::AddShader(const Shader& shader)
{
    int ret = CListBox::AddString(GetTitle(shader));
    if (ret >= 0) {
        m_List.push_back(shader);
    }
    return ret;
}
Esempio n. 15
0
HWND CConsole::GetHWND()
{
    if(hConsole == NULL)
        return NULL;

    // try to find our console window and return its HWND
    return FindWindow("ConsoleWindowClass",GetTitle());
}
Esempio n. 16
0
int CShaderListBox::InsertShader(int nIndex, const Shader& shader)
{
    int ret = CListBox::InsertString(nIndex, GetTitle(shader));
    if (ret >= 0) {
        m_List.insert(m_List.begin() + ret, shader);
    }
    return ret;
}
Esempio n. 17
0
//___________________________________________________________________________________________
void KVIntegerList::DeducePopulationFromTitle()
{
//protected method, utilisee par le Streamer

   KVString st(GetTitle());
   SetPopulation(st.Atoi());

}
Esempio n. 18
0
void WeightsManFrame::OnActivate(wxActivateEvent& event)
{
	LOG_MSG("In WeightsManFrame::OnActivate");
	if (event.GetActive()) {
		RegisterAsActive("WeightsManFrame", GetTitle());
	}
    if ( event.GetActive() && template_canvas ) template_canvas->SetFocus();
}
NS_IMETHODIMP
WebBrowserPersistLocalDocument::GetTitle(nsAString& aTitle)
{
    nsAutoString titleBuffer;
    mDocument->GetTitle(titleBuffer);
    aTitle = titleBuffer;
    return NS_OK;
}
OP_STATUS PageBasedAutocompleteItem::UpdateRank(const OpStringC& match_text)
{
	m_rank = 0;
	// title match
	OpString title;
	RETURN_IF_ERROR(GetTitle(title));
	if (m_search_type == PAGE_CONTENT)
		m_rank += CalculateRank(match_text, title, " ", RANK_PAGE_TITLE_FACTOR / 2);
	else
		m_rank += CalculateRank(match_text, title, " ", RANK_PAGE_TITLE_FACTOR);

	// url address match
	OpString address;
	RETURN_IF_ERROR(GetStrippedAddress(address));
	m_rank += CalculateRank(match_text, address, "/", RANK_PAGE_URL_FACTOR);

	if (m_search_type == BOOKMARK)
	{
		m_rank = m_rank * 2; // bookmark bonus;

		if (m_bookmark)
			m_rank += CalculateRank(match_text, m_bookmark->GetName(), " ", RANK_BOOKMARK_TITLE_FACTOR);

		// for bookmarks display and go to url address might be not the same thing, which is awesome;)
		OpString display_addr;
		if(HasDisplayAddress() && OpStatus::IsSuccess(GetDisplayAddress(display_addr)))
		{
			OpString domain;
			unsigned domain_offset = 0;
			RETURN_IF_ERROR(StringUtils::FindDomain(display_addr, domain, domain_offset));

			OpString cut_address;
			RETURN_IF_ERROR(cut_address.Set(display_addr.SubString(domain_offset).CStr()));
			m_rank += CalculateRank(match_text, cut_address, "/", RANK_PAGE_URL_FACTOR);
		}

		OpAutoVector<OpString> nick_urls;
		if (address.HasContent() && !uni_strpbrk(address.CStr(), UNI_L(".:/?\\")))
			g_hotlist_manager->ResolveNickname(address, nick_urls);

		// Check if it's a bookmark nickname
		if (nick_urls.GetCount() >= 1)
		{
			// address might have nick value, in case we deal with nicknamed bookmark
			if (address == match_text)
				m_rank += RANK_BOOKMARK_NICKNAME_FACTOR;
			else
				m_rank += CalculateRank(match_text, address, " ", RANK_PAGE_URL_FACTOR) * 2;
		}
	}

	// time ranking
	time_t two_months_earlier = g_timecache->CurrentTime() - 60*24*60*60;
	time_t access_time = GetAccessed();
	m_rank += max(RANK_TIME_FACTOR * (access_time - two_months_earlier) / (60*24*60*60) , RANK_TIME_MAX_DOWNGRADE);

	return OpStatus::OK;
}
Esempio n. 21
0
void TestScrollWinFrame::OnActivate(wxActivateEvent& event)
{
  //LOG_MSG("In TestScrollWinFrame::OnActivate");
	if (event.GetActive()) {
		RegisterAsActive("TestScrollWinFrame", GetTitle());
	}
    if ( event.GetActive() && template_canvas )
        template_canvas->SetFocus();
}
Esempio n. 22
0
// The application preferences have changed, so update any elements that may
// depend on them.
void ToolBar::UpdatePrefs()
{
#if wxUSE_TOOLTIPS
   // Change the tooltip of the grabber
   mGrabber->SetToolTip( GetTitle() );
#endif

   return;
}
Esempio n. 23
0
static void OnGetParam ( ButtoN b ) {
 Int2 cl, subcl, tp;
 Int4 param;
 Char buf[30];
 int  xxx;

 GetTitle ( dlg1, buf, 30 ); buf[29] = 0;
 sscanf ( buf, "%d", &xxx ); cl = (Int2)xxx;
 GetTitle ( dlg2, buf, 30 ); buf[29] = 0;
 sscanf ( buf, "%d", &xxx ); subcl = (Int2)xxx;
 GetTitle ( dlg3, buf, 30 ); buf[29] = 0;
 sscanf ( buf, "%d", &xxx ); tp = (Int2)xxx;

 param = GetMuskCParam ( cl, subcl, tp );

 sprintf ( buf, "%ld", (long)param );
 SetTitle ( dlg4, buf );
}
void ConditionalHistogramFrame::OnActivate(wxActivateEvent& event)
{
	LOG_MSG("In ConditionalHistogramFrame::OnActivate");
	if (event.GetActive()) {
		RegisterAsActive("ConditionalHistogramFrame", GetTitle());
	}
    if ( event.GetActive() && template_canvas )
        template_canvas->SetFocus();
}
Esempio n. 25
0
BOOL DocRoot::SaveDocument(const char* pszPathName)
  {
  if (gs_Exec.Busy())
    {
    LogError("SysCAD", 0, "Must not be running");
    return False;
    }
  char Fn[512];
  CString TmpFn;
  if (pszPathName==NULL)
    {
    TmpFn=GetTitle();
    pszPathName = TmpFn.GetBuffer(0);
    }
  
  if (strpbrk(pszPathName, ":\\")==NULL)
    {
    strcpy(Fn, PrjFiles());
    strcat(Fn, pszPathName);
    }
  else
    strcpy(Fn, pszPathName);

  CString Ext;
  VERIFY(GetDocTemplate()->GetDocString(Ext, CDocTemplate::filterExt));
  pchar ext=Ext.GetBuffer(0);
  const int l=strlen(Fn);
  const int el=strlen(ext);
  if (l<=el)
    strcat(Fn, ext);
  else if (_stricmp(&Fn[l-el], ext)!=0)
    {
    if (Fn[l-el]=='.')
      Fn[l-el]=0; //"old" or "incorect" extension needs to be replaced
    strcat(Fn, ext);
    }

  FILE* pFile= fopen(Fn, "wt");
  flag b=(pFile!=NULL);

  if (b)
    b=WriteDocument(Fn, pFile);

  if (pFile) 
    fclose(pFile);
  if (b)
    {
    SetPathName(Fn);
    SetModifiedFlag(FALSE);
    gs_pCmd->Print("%s - Saved\n", Fn);
    }
  else
    {
    gs_pCmd->Print("%s - NOT SAVED\n", Fn);
    }
  return b;
  }
Esempio n. 26
0
void BookmarksModel::AddBookmarks (const Bookmarks_t& bookmarks)
{
    Bookmarks_t bmss = bookmarks;
    for (int i = bmss.count () - 1; i >= 0; --i)
    {
        auto bms = bmss.at (i);
        auto it = std::find_if (Bookmarks_.begin (), Bookmarks_.end (),
                                [bms] (decltype (Bookmarks_.front ()) bookmark)
        {
            return bms->GetID () == bookmark->GetID ();
        });
        if (it != Bookmarks_.end ())
        {
            const int pos = std::distance (Bookmarks_.begin (), it);
            switch (bms->GetStatus ())
            {
            case Bookmark::SDeleted:
                RemoveBookmark (bms->GetID ());
                break;
            case Bookmark::SArchived:
            {
                Bookmark *bm = Bookmarks_ [pos];
                bm->SetIsRead (true);

                emit dataChanged (index (pos), index (pos));

                break;
            }
            default:
            {
                Bookmark *bm = Bookmarks_ [pos];
                bm->SetUrl (bms->GetUrl ());
                bm->SetTitle (bms->GetTitle ());
                bm->SetDescription (bms->GetDescription ());
                bm->SetIsFavorite (bms->IsFavorite ());
                bm->SetIsRead (bms->IsRead ());
                bm->SetAddTime (bms->GetAddTime ());
                bm->SetUpdateTime (bms->GetUpdateTime ());
                bm->SetTags (bms->GetTags ());
                bm->SetImageUrl (bms->GetImageUrl ());
                bm->SetStatus (bms->GetStatus ());

                emit dataChanged (index (pos), index (pos));

                break;
            }
            }

            bmss.takeAt (i)->deleteLater ();
        }
    }

    beginInsertRows (QModelIndex (), rowCount (),
                     rowCount () + bmss.count () - 1);
    Bookmarks_.append (bmss);
    endInsertRows ();
}
Esempio n. 27
0
STDMETHODIMP 
CXRefreshToolbar::GetBandInfo(DWORD dwBandId, DWORD dwViewMode, DESKBANDINFO *pdbi)
{
	DT(TRACE_I(FS(_T("Toolbar[%08X]: GetBandInfo(...)"), this)));
	try
	{
		if( pdbi == NULL )
			return E_INVALIDARG;

		m_dwBandId = dwBandId;
		m_dwViewMode = dwViewMode;

		if( pdbi->dwMask & DBIM_MINSIZE )
		{
			pdbi->ptMinSize = GetMinSize();
		}

		if( pdbi->dwMask & DBIM_MAXSIZE )
		{
			pdbi->ptMaxSize = GetMaxSize();
		}

		if( pdbi->dwMask & DBIM_INTEGRAL )
		{
			pdbi->ptIntegral.x = 1;
			pdbi->ptIntegral.y = 1;
		}

		if( pdbi->dwMask & DBIM_ACTUAL )
		{
			pdbi->ptActual = GetActualSize();
		}

		if( pdbi->dwMask & DBIM_TITLE )
		{
			wcscpy_s(pdbi->wszTitle, GetTitle());
		}

		if( pdbi->dwMask & DBIM_MODEFLAGS )
		{
			pdbi->dwModeFlags = DBIMF_NORMAL | DBIMF_USECHEVRON;
		}

		if( pdbi->dwMask & DBIM_BKCOLOR )
		{
			// use the default background color by removing this flag
			pdbi->dwMask &= ~DBIM_BKCOLOR;
		}

		return S_OK;
	}
	catch (CXRefreshRuntimeError &ex)
	{
		HandleError(ex.ErrorMessage());
		return E_FAIL;
	}
}
Esempio n. 28
0
void TITLE_BLOCK::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControlBits ) const
    throw( IO_ERROR )
{
    // Don't write the title block information if there is nothing to write.
    bool isempty = true;
    for( unsigned idx = 0; idx < m_tbTexts.GetCount(); idx++ )
    {
        if( ! m_tbTexts[idx].IsEmpty() )
        {
            isempty = false;
            break;
        }
    }

    if( !isempty  )
    {
        aFormatter->Print( aNestLevel, "(title_block\n" );

        if( !GetTitle().IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(title %s)\n",
                               aFormatter->Quotew( GetTitle() ).c_str() );

        if( !GetDate().IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(date %s)\n",
                               aFormatter->Quotew( GetDate() ).c_str() );

        if( !GetRevision().IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(rev %s)\n",
                               aFormatter->Quotew( GetRevision() ).c_str() );

        if( !GetCompany().IsEmpty() )
            aFormatter->Print( aNestLevel+1, "(company %s)\n",
                               aFormatter->Quotew( GetCompany() ).c_str() );

        for( int ii = 0; ii < 4; ii++ )
        {
            if( !GetComment(ii).IsEmpty() )
                aFormatter->Print( aNestLevel+1, "(comment %d %s)\n", ii+1,
                                  aFormatter->Quotew( GetComment(ii) ).c_str() );
        }

        aFormatter->Print( aNestLevel, ")\n\n" );
    }
}
Esempio n. 29
0
static void Cn3D_ExportPDBNow(ButtoN b)
{

    Char path[256];
    FILE *pFile;
    Int2 iTest;
    Int4 iCount = 0;
    PDNMS pdnmsMain = NULL;

    Int2Ptr i2Vec = NULL;


    i2Vec = PickedModels(&iCount);
    if (iCount == 0) {
        ErrClear();
        ErrPostEx(SEV_INFO, 0, 0, "Nothing to save!");
        ErrShow();
        Disable(Cn3D_bPDBOk);
        return;
    }

    GetTitle(Cn3D_tPDBSave, path, sizeof(path));
    pdnmsMain = GetSelectedModelstruc();
#ifdef WIN_MAC
    FileCreate(path, "TEXT", "ttxt");
#endif
    WatchCursor();
    pFile = FileOpen(path, "w");
    if (pFile) {
        iTest = WritePDBModelList(pdnmsMain, pFile, iCount, i2Vec);
        I2VectorFree(i2Vec, 0);
        if (!iTest) {
            ErrClear();
            ErrPostEx(SEV_FATAL, 0, 0,
                      "Unable to Export\nPossibly Corrupt Data in Memory!\n");
            ErrShow();
        }
        fflush(pFile);
        fclose(pFile);
    } else {
        ErrClear();
        ErrPostEx(SEV_INFO, 0, 0, "Sorry, Unable to Open File:\n %s",
                  path);
        ErrShow();
        Disable(Cn3D_bPDBOk);
        I2VectorFree(i2Vec, 0);
        SetTitle(Cn3D_tPDBSave, "\0");
        ArrowCursor();
        return;
    }
    Remove(Cn3D_wPDBSave);
    Cn3D_EnableFileOps();
    Cn3D_Export_InUse = FALSE;
    ArrowCursor();
    return;
}
Esempio n. 30
0
int MathPrintout::GetHeaderHeight()
{
  wxDC *dc = GetDC();
  double ppiScale = GetPPIScale();
  int width, height;

  dc->SetFont(wxFont(SCALE_PX(10, ppiScale), wxMODERN, wxNORMAL, wxNORMAL));
  dc->GetTextExtent(GetTitle(), &width, &height);
  return height + SCALE_PX(12, ppiScale);
}