Beispiel #1
0
bool PCB_EDIT_FRAME::doAutoSave()
{
    wxFileName tmpFileName;

    if( GetBoard()->GetFileName().IsEmpty() )
    {
        tmpFileName = wxFileName( wxStandardPaths::Get().GetDocumentsDir(), wxT( "noname" ),
                                  KiCadPcbFileExtension );
        GetBoard()->SetFileName( tmpFileName.GetFullPath() );
    }
    else
    {
        tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
    }

    wxFileName autoSaveFileName = tmpFileName;

    // Auto save file name is the board file name prepended with autosaveFilePrefix string.
    autoSaveFileName.SetName( GetAutoSaveFilePrefix() + autoSaveFileName.GetName() );

    if( !autoSaveFileName.IsOk() )
        return false;

    // If the board file path is not writable, try writing to a platform specific temp file
    // path.  If that path isn't writabe, give up.
    if( !autoSaveFileName.IsDirWritable() )
    {
        autoSaveFileName.SetPath( wxFileName::GetTempDir() );

        if( !autoSaveFileName.IsOk() || !autoSaveFileName.IsDirWritable() )
            return false;
    }

    wxLogTrace( traceAutoSave, "Creating auto save file <" + autoSaveFileName.GetFullPath() + ">" );

    if( SavePcbFile( autoSaveFileName.GetFullPath(), NO_BACKUP_FILE ) )
    {
        GetScreen()->SetModify();
        GetBoard()->SetFileName( tmpFileName.GetFullPath() );
        UpdateTitle();
        m_autoSaveState = false;
        return true;
    }

    GetBoard()->SetFileName( tmpFileName.GetFullPath() );

    return false;
}
/*
================
rvGEWorkspace::SaveFile

Writes the contents of the open gui file to disk
================
*/
bool rvGEWorkspace::SaveFile ( const char* filename )
{
	idFile*		file;
	idWindow*	window;

	SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_WAIT ) ) );

	mFilename = filename;

	// Since quake can only write to its path we will write a temp file then copy it over
	idStr tempfile;
	idStr ospath;

	tempfile = "guis/temp.guied";
	ospath = fileSystem->RelativePathToOSPath ( tempfile, "fs_basepath" );

	// Open the output file for write
	if ( !(file = fileSystem->OpenFileWrite ( tempfile ) ) )
	{
		int error = GetLastError ( );
		SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW ) ) );
		return false;
	}

	window = mInterface->GetDesktop ( );

	WriteWindow ( file, 1, window );

	fileSystem->CloseFile ( file );

	if ( !CopyFile ( ospath, filename, FALSE ) )
	{
		DeleteFile ( ospath );
		SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW ) ) );
		return false;
	}

	DeleteFile ( ospath );

	mFilename = filename;
	mModified = false;
	mNew      = false;
	UpdateTitle ( );

	SetCursor ( LoadCursor ( NULL, MAKEINTRESOURCE(IDC_ARROW ) ) );

	return true;
}
Beispiel #3
0
// Display FPS info
// This should only be called from VI
void VideoThrottle()
{
  // Update info per second
  u32 ElapseTime = (u32)s_timer.GetTimeDifference();
  if ((ElapseTime >= 1000 && s_drawn_video.load() > 0) || s_request_refresh_info)
  {
    UpdateTitle();

    // Reset counter
    s_timer.Update();
    s_drawn_frame.store(0);
    s_drawn_video.store(0);
  }

  s_drawn_video++;
}
Beispiel #4
0
// Apply Frame Limit and Display FPS info
// This should only be called from VI
void VideoThrottle()
{
	// Update info per second
	u32 ElapseTime = (u32)Timer.GetTimeDifference();
	if ((ElapseTime >= 1000 && DrawnVideo > 0) || g_requestRefreshInfo)
	{
		UpdateTitle();

		// Reset counter
		Timer.Update();
		Common::AtomicStore(DrawnFrame, 0);
		DrawnVideo = 0;
	}

	DrawnVideo++;
}
Beispiel #5
0
void CThhylDlg::CloseFile(BOOL bSilently)
{
	m_filestatus.Clear();
	m_bTHX = FALSE;
	delete m_pRpyAnalyzer;
	m_pRpyAnalyzer = NULL;
	delete []m_pRpyData;
	m_pRpyData = NULL;
	if (bSilently)
		return;

	m_rpyfile.LoadString(IDS_HINTNOFILE);
	m_rpyinfo.LoadString(IDS_HINTSTART);
	UpdateTitle();
	UpdateData(FALSE);
}
// Apply Frame Limit and Display FPS info
// This should only be called from VI
void VideoThrottle()
{
	// Update info per second
	u32 ElapseTime = (u32)s_timer.GetTimeDifference();
	if ((ElapseTime >= 1000 && s_drawn_video > 0) || s_request_refresh_info)
	{
		UpdateTitle();

		// Reset counter
		s_timer.Update();
		Common::AtomicStore(s_drawn_frame, 0);
		s_drawn_video = 0;
	}

	s_drawn_video++;
}
Beispiel #7
0
void TrayIcon::AddTrayIcon()
{
	_ASSERTE(IconData.hIcon!=NULL);

	if (!mb_WindowInTray)
	{
		mb_SecondTimeoutMsg = false; mn_BalloonShowTick = 0;
		GetWindowText(ghWnd, IconData.szTip, countof(IconData.szTip));
		Shell_NotifyIcon(NIM_ADD, (NOTIFYICONDATA*)&IconData);
		mb_WindowInTray = true;
	}
	else
	{
		UpdateTitle();
	}
}
// Set up appropriate views for the intermediate render target.
void D3D12Fullscreen::LoadSceneResolutionDependentResources()
{
	// Update resolutions shown in app title.
	UpdateTitle();

	// Set up the scene viewport and scissor rect to match the current scene rendering resolution.
	{
		m_sceneViewport.Width = static_cast<float>(m_resolutionOptions[m_resolutionIndex].Width);
		m_sceneViewport.Height = static_cast<float>(m_resolutionOptions[m_resolutionIndex].Height);
		m_sceneViewport.MaxDepth = 1.0f;

		m_sceneScissorRect.right = static_cast<LONG>(m_resolutionOptions[m_resolutionIndex].Width);
		m_sceneScissorRect.bottom = static_cast<LONG>(m_resolutionOptions[m_resolutionIndex].Height);
	}

	// Update post-process viewport and scissor rectangle.
	UpdatePostViewAndScissor();

	// Create RTV for the intermediate render target.
	{
		D3D12_RESOURCE_DESC swapChainDesc = m_renderTargets[m_frameIndex]->GetDesc();
		const CD3DX12_CLEAR_VALUE clearValue(swapChainDesc.Format, ClearColor);
		const CD3DX12_RESOURCE_DESC renderTargetDesc = CD3DX12_RESOURCE_DESC::Tex2D(
			swapChainDesc.Format,
			m_resolutionOptions[m_resolutionIndex].Width,
			m_resolutionOptions[m_resolutionIndex].Height,
			1u, 1u,
			swapChainDesc.SampleDesc.Count,
			swapChainDesc.SampleDesc.Quality,
			D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET,
			D3D12_TEXTURE_LAYOUT_UNKNOWN, 0u);

		CD3DX12_CPU_DESCRIPTOR_HANDLE rtvHandle(m_rtvHeap->GetCPUDescriptorHandleForHeapStart(), FrameCount, m_rtvDescriptorSize);
		ThrowIfFailed(m_device->CreateCommittedResource(
			&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT),
			D3D12_HEAP_FLAG_NONE,
			&renderTargetDesc,
			D3D12_RESOURCE_STATE_RENDER_TARGET,
			&clearValue,
			IID_PPV_ARGS(&m_intermediateRenderTarget)));
		m_device->CreateRenderTargetView(m_intermediateRenderTarget.Get(), nullptr, rtvHandle);
		NAME_D3D12_OBJECT(m_intermediateRenderTarget);
	}

	// Create SRV for the intermediate render target.
	m_device->CreateShaderResourceView(m_intermediateRenderTarget.Get(), nullptr, m_cbvSrvHeap->GetCPUDescriptorHandleForHeapStart());
}
Beispiel #9
0
	LRESULT OnCreate(LPCREATESTRUCT lParam)
	{
		SetMsgHandled(false);
		T *pT = static_cast<T*>(this);
		g_window[pT->ID] = m_hWnd;

		pT->DoCreateView();
		ATLASSERT(m_hWndClient);

		CMessageLoop * pLoop = _Module.GetMessageLoop();
		ATLASSERT(NULL != pLoop);
		pLoop->AddIdleHandler(this);

		UpdateTitle();

		return 0;
	}
Beispiel #10
0
bool MainFrame::DoFileOpen(LPCTSTR lpstrFileName, LPCTSTR lpstrFileTitle)
{
   bool bRet = m_view.Load(lpstrFileName) != FALSE;
   if (bRet)
   {
      m_view.Init(lpstrFileName, lpstrFileTitle);
      UpdateTitle();
   }
   else
   {
      CString cszText;
      cszText.Format(_T("Error reading file!\nFilename: %s"), lpstrFileName);
      AtlMessageBox(m_hWnd, cszText.GetString(), IDR_MAINFRAME, MB_OK | MB_ICONERROR);
   }

   return bRet;
}
Beispiel #11
0
/*
================
rvGEWorkspace::Attach

Attaches the workspace to the given window.  This is usually done after the
window is created and the file has been loaded.
================
*/
bool rvGEWorkspace::Attach ( HWND wnd )
{
	assert ( wnd );

	mWnd = wnd;

	// Initialize the pixel format for this window
	SetupPixelFormat ( );

	// Jam the workspace pointer into the userdata window long so
	// we can retrieve the workspace from the window later
	SetWindowLong ( mWnd, GWL_USERDATA, (LONG) this );

	UpdateTitle ( );

	return true;
}
void FOOTPRINT_VIEWER_FRAME::SelectCurrentLibrary( wxCommandEvent& event )
{
    wxString selection = SelectLibrary( m_libraryName );

    if( !!selection && selection != m_libraryName )
    {
        m_libraryName = selection;

        UpdateTitle();
        ReCreateFootprintList();

        int id = m_libList->FindString( m_libraryName );

        if( id >= 0 )
            m_libList->SetSelection( id );
    }
}
Beispiel #13
0
/// This method checks the list of pending commands and executes the next command
void CMediaMonitor::DispatchNextCommand()
{
  if (m_commands.size() <= 0)
  {
    return ;
  }

  EnterCriticalSection(&m_critical_section);

  COMMANDITERATOR it = m_commands.begin();
  CMediaMonitor::Command command = *it;
  m_commands.erase(it);

  LeaveCriticalSection(&m_critical_section);

  switch (command.rCommand)
  {
  case CommandType::Seed:
    {
      // update all movie information
      CLog::Log(LOGINFO, "Seeding database... started.");
      Scan(true);
      CLog::Log(LOGINFO, "Seeding database... completed.");
      break;
    }

  case CommandType::Refresh:
    {
      // get information for the latest 3 movies
      CLog::Log(LOGINFO, "Refreshing latest movies... started.");
      Scan(false);
      CLog::Log(LOGINFO, "Refreshing latest movies... completed.");
      break;
    }

  case CommandType::Update:
    {
      // update the information for a specific movie
      CLog::Log(LOGINFO, "Updating movie... started.");
      UpdateTitle(command.nParam1, command.strParam1, command.strParam2);
      CLog::Log(LOGINFO, "Updating movie... completed.");
      break;
    }
  }
}
void FOOTPRINT_VIEWER_FRAME::ClickOnLibList( wxCommandEvent& event )
{
    int ii = m_libList->GetSelection();

    if( ii < 0 )
        return;

    wxString name = m_libList->GetString( ii );

    if( m_libraryName == name )
        return;

    m_libraryName = name;

    ReCreateFootprintList();
    UpdateTitle();
    ReCreateHToolbar();
}
/*
================
rvGEWorkspace::LoadFile

Loads the given gui file.
================
*/
bool rvGEWorkspace::LoadFile( const char *filename, idStr *error ) {
	delete mInterface;
	idStr tempfile;
	idStr ospath;
	bool  result;
	tempfile = "guis/temp.guied";
	ospath = fileSystem->RelativePathToOSPath( tempfile, "fs_basepath" );
	// Make sure the gui directory exists
	idStr createDir = ospath;
	createDir.StripFilename( );
	CreateDirectory( createDir, NULL );
	SetFileAttributes( ospath, FILE_ATTRIBUTE_NORMAL );
	DeleteFile( ospath );
	if( !CopyFile( filename, ospath, FALSE ) ) {
		if( error ) {
			*error = "File not found";
		}
		return false;
	}
	SetFileAttributes( ospath, FILE_ATTRIBUTE_NORMAL );
	mFilename = filename;
	UpdateTitle( );
	// Let the real window system parse it first
	mInterface = NULL;
	result     = true;
	try {
		mInterface = reinterpret_cast< idUserInterfaceLocal * >( uiManager->FindGui( tempfile, true, true ) );
		if( !mInterface && error ) {
			*error = "File not found";
		}
	} catch( idException &e ) {
		result = false;
		if( error ) {
			*error = e.error;
		}
		return false;
	}
	if( result ) {
		rvGEWindowWrapper::GetWrapper( mInterface->GetDesktop( ) )->Expand( );
	} else {
		DeleteFile( ospath );
	}
	return result;
}
void CEsmSpellDlg::OnInitialUpdate() {

    int Index;



    CEsmRecDialog::OnInitialUpdate();

    UpdateTitle(NULL);



    /* Initialize the armor record */

    ASSERT(GetRecInfo() != NULL);

    m_pSpell = (CEsmSpell *) GetRecInfo()->pRecord;

    FillEsmSpellTypeCombo(m_TypeList);



    for (Index = 0; Index < MWESM_ENCHANT_NUMENCHANTS; Index++) {

        FillEsmEffectsCombo(m_EffectList[Index], false);

        FillEsmEnchantRangeCombo(m_RangeList[Index]);

        m_DurationText[Index].SetLimitText(5);	/* Are shorts so only need 5 digits at most */

        m_Magnitude1Text[Index].SetLimitText(5);

        m_Magnitude2Text[Index].SetLimitText(5);

        m_AreaText[Index].SetLimitText(5);

    }



    SetControlData();

}
void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event )
{
    if( m_footprintList->GetCount() == 0 )
        return;

    int ii = m_footprintList->GetSelection();

    if( ii < 0 )
        return;

    wxString name = m_footprintList->GetString( ii );

    if( m_footprintName.CmpNoCase( name ) != 0 )
    {
        m_footprintName = name;
        SetCurItem( NULL );

        // Delete the current footprint
        GetBoard()->m_Modules.DeleteAll();

        FPID id;
        id.SetLibNickname( m_libraryName );
        id.SetFootprintName( m_footprintName );

        try
        {
            GetBoard()->Add( loadFootprint( id ) );
        }
        catch( const IO_ERROR& ioe )
        {
            wxString msg;
            msg.Printf( _( "Could not load footprint \"%s\" from library \"%s\".\n\n"
                           "Error %s." ), GetChars( m_footprintName ), GetChars( m_libraryName ),
                        GetChars( ioe.errorText ) );
            DisplayError( this, msg );
        }

        UpdateTitle();
        Zoom_Automatique( false );
        m_canvas->Refresh();
        Update3D_Frame();
    }
}
Beispiel #18
0
void SCH_EDIT_FRAME::Save_File( wxCommandEvent& event )
{
    int id = event.GetId();

    switch( id )
    {
    case ID_UPDATE_ONE_SHEET:
        SaveEEFile( NULL );
        break;

    case ID_SAVE_ONE_SHEET_UNDER_NEW_NAME:
        if( SaveEEFile( NULL, true ) )
        {
            CreateArchiveLibraryCacheFile( true );
        }
        break;
    }

    UpdateTitle();
}
nsresult
VideoDocument::CreateSyntheticVideoDocument(nsIChannel* aChannel,
                                            nsIStreamListener** aListener)
{
  // make our generic document
  nsresult rv = MediaDocument::CreateSyntheticDocument();
  NS_ENSURE_SUCCESS(rv, rv);

  Element* body = GetBodyElement();
  if (!body) {
    NS_WARNING("no body on video document!");
    return NS_ERROR_FAILURE;
  }

  // make content
  nsCOMPtr<nsINodeInfo> nodeInfo;
  nodeInfo = mNodeInfoManager->GetNodeInfo(nsGkAtoms::video, nullptr,
                                           kNameSpaceID_XHTML,
                                           nsIDOMNode::ELEMENT_NODE);
  NS_ENSURE_TRUE(nodeInfo, NS_ERROR_FAILURE);

  nsRefPtr<nsHTMLMediaElement> element =
    static_cast<nsHTMLMediaElement*>(NS_NewHTMLVideoElement(nodeInfo.forget(),
                                                            NOT_FROM_PARSER));
  if (!element)
    return NS_ERROR_OUT_OF_MEMORY;
  element->SetAutoplay(true);
  element->SetControls(true);
  element->LoadWithChannel(aChannel, aListener);
  UpdateTitle(aChannel);

  if (nsContentUtils::IsChildOfSameType(this)) {
    // Video documents that aren't toplevel should fill their frames and
    // not have margins
    element->SetAttr(kNameSpaceID_None, nsGkAtoms::style,
        NS_LITERAL_STRING("position:absolute; top:0; left:0; width:100%; height:100%"),
        true);
  }

  return body->AppendChildTo(element, false);
}
void ExploreFrame::OnAddClicked( wxCommandEvent& event )
{
	wxFileDialog fileDlg(this, _("Select file to add"), wxString(), wxString(), "*.*", wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST);
	if (fileDlg.ShowModal() == wxID_OK)
	{
		wxFileName newFN(fileDlg.GetPath());
		wxString newEntryName = newFN.GetFullName();
		
		wxTextEntryDialog dlg(this, _("Enter filename in WAD"), _("Add resource"), newEntryName);
		if (dlg.ShowModal() == wxID_OK)
		{
			newEntryName = dlg.GetValue();
			WADArchiveEntry entry(newEntryName, fileDlg.GetPath());
			entry.SetStatus(WADArchiveEntry::Entry_Added);
			m_archive->Add(entry);
			static_cast<FileDataModel*>(m_fileListCtrl->GetModel())->RowAppended();

			UpdateTitle();
		}
	}
}
void CEsmBodyPartDlg::OnInitialUpdate() {
  CEsmRecDialog::OnInitialUpdate();
  UpdateTitle(NULL);
  
	/* Initialize the record */
  ASSERT(GetRecInfo() != NULL);
  m_pBodyPart = (CEsmBodyPart *) GetRecInfo()->pRecord;

	/* Set text limits */
  m_IDText.SetLimitText(MWESM_ID_MAXSIZE);

	/* Disable controls */
  m_PlayableCheck.EnableWindow(FALSE);

	/* Fill the various lists */
  FillEsmBodyPartCombo(m_PartList);
  FillEsmBodyPartTypeCombo(m_PartTypeList);
  FillEsmRaceCombo(m_RaceList);

  SetControlData();
 }
void CEsmArmorDlg::SetControlData (void) {

	/* Ignore if the current item is not valid */
  if (m_pArmor == NULL) return;

	/* Armor ID, update title as well */
  m_IDText.SetWindowText(m_pArmor->GetID());
  UpdateTitle(m_pArmor->GetID());

	/* Item strings and values */
  m_NameText.SetWindowText(m_pArmor->GetName());
  m_RatingText.SetWindowText(m_pArmor->GetFieldString(ESM_FIELD_RATING));
  m_HealthText.SetWindowText(m_pArmor->GetFieldString(ESM_FIELD_HEALTH));
  m_WeightText.SetWindowText(m_pArmor->GetFieldString(ESM_FIELD_WEIGHT));
  m_ValueText.SetWindowText(m_pArmor->GetFieldString(ESM_FIELD_VALUE));
  m_EnchantText.SetWindowText(m_pArmor->GetFieldString(ESM_FIELD_ENCHANTPTS));
  m_NameText.SetModify(FALSE);
  m_RatingText.SetModify(FALSE);
  m_HealthText.SetModify(FALSE);
  m_WeightText.SetModify(FALSE);
  m_ValueText.SetModify(FALSE);
  m_EnchantText.SetModify(FALSE);

	/* Model/icon buttons */
  m_ModelButton.SetWindowText(m_pArmor->GetModel());
  m_IconButton.SetWindowText(m_pArmor->GetIcon());
  m_IconPicture.SetEsmIcon(m_pArmor->GetIcon());
  
	/* Item lists */
  FindComboListItem(m_TypeList, m_pArmor->GetArmorTypeID(), true);
  m_EnchantList.SelectString(-1, m_pArmor->GetEnchant());
  m_ScriptList.SelectString(-1, m_pArmor->GetScript());

	/* Record flags */
  m_BlockedCheck.SetCheck(m_pArmor->IsBlocked());
  m_PersistCheck.SetCheck(m_pArmor->IsPersist());

	/* Set all the biped part data */
  SetBipedData();
 }
void CEsmArmorDlg::OnInitialUpdate() {
  int Index;

  CEsmRecDialog::OnInitialUpdate();
  UpdateTitle(NULL);

  //HICON hIcon;
  //hIcon = AfxGetApp()->LoadIcon(IDI_ARMOR);
  //GetParentFrame()->SetIcon(hIcon, FALSE);
  //SetIcon(hIcon, FALSE);

  //CMenu Menu;
  //Menu.LoadMenu(IDR_LIST_MENU);
  //((CChildFrameFix *)GetParentFrame())->SetSharedMenu(Menu.GetSafeHmenu());
  //((CFrameWnd*)AfxGetMainWnd())->OnUpdateFrameMenu(Menu.GetSafeHmenu());
  //((CFrameWnd*)AfxGetMainWnd())>OnUpdateFrameMenu(NULL) ;
  //((CFrameWnd*)AfxGetMainWnd())->DrawMenuBar();
  
	/* Initialize the armor record */
  ASSERT(GetRecInfo() != NULL);
  m_pArmor = (CEsmArmor *) GetRecInfo()->pRecord;

	/* Initialize the ui controls/lists */
  FillEsmArmorTypeCombo(m_TypeList);
  FillEsmScriptCombo(m_ScriptList);
  FillEsmEnchantCombo(m_EnchantList);
  m_IDText.SetLimitText(MWESM_ID_MAXSIZE);
  m_NameText.SetLimitText(MWESM_ID_MAXSIZE);
  m_EnchantText.SetLimitText(16);
  m_WeightText.SetLimitText(16);
  m_RatingText.SetLimitText(16);
  m_HealthText.SetLimitText(16);
  m_ValueText.SetLimitText(16);

  for (Index = 0; Index < MWESM_ARMOR_MAXBODYPARTS; Index++) {
    FillEsmBodyPartsCombo(m_BipedList[Index]);
   }

  SetControlData();
 }
void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode )
{
    if( !m_libraryName )
        return;

    int selection = m_footprintList->FindString( m_footprintName );

    if( aMode == NEXT_PART )
    {
        if( selection != wxNOT_FOUND && selection < (int)m_footprintList->GetCount()-1 )
            selection++;
    }

    if( aMode == PREVIOUS_PART )
    {
        if( selection != wxNOT_FOUND && selection > 0 )
            selection--;
    }

    if( selection != wxNOT_FOUND )
    {
        m_footprintList->SetSelection( selection );
        m_footprintName = m_footprintList->GetString( selection );
        SetCurItem( NULL );

        // Delete the current footprint
        GetBoard()->m_Modules.DeleteAll();

        MODULE* footprint = FootprintLibs()->FootprintLoad( m_libraryName, m_footprintName );

        if( footprint )
            GetBoard()->Add( footprint, ADD_APPEND );

        Update3D_Frame();
    }

    UpdateTitle();
    Zoom_Automatique( false );
    m_canvas->Refresh();
}
void CEsmRegionDlg::OnInitialUpdate() {
  CEsmRecDialog::OnInitialUpdate();
  UpdateTitle(NULL);

	/* Initialize the armor record */
  ASSERT(GetRecInfo() != NULL);
  m_pRegion = (CEsmRegion *) GetRecInfo()->pRecord;

	/* Sound List */
  m_SoundList.OnInitCtrl();
  m_SoundList.SetDlgHandler(m_pParent);
  m_SoundList.SetEnableDrag(true);
  m_SoundList.SetAcceptDrag(true);
  m_SoundList.SetWantKeys(true);
  m_SoundList.InitObjectList(&l_SoundColData[0]);

	/* Initialize the text controls */
  m_IDText.SetLimitText(MWESM_ID_MAXSIZE);
  m_NameText.SetLimitText(MWESM_ID_MAXSIZE);
  m_ThunderText.SetLimitText(8);
  m_RainText.SetLimitText(8);
  m_BlightText.SetLimitText(4);
  m_AshText.SetLimitText(4);
  m_OvercastText.SetLimitText(4);
  m_FoggyText.SetLimitText(4);
  m_ClearText.SetLimitText(4);
  m_CloudyText.SetLimitText(4);
  m_RedText.SetLimitText(4);
  m_BlueText.SetLimitText(4);
  m_GreenText.SetLimitText(4);
  m_RSpin.SetRange32(0, 255);
  m_GSpin.SetRange32(0, 255);
  m_BSpin.SetRange32(0, 255);
   
	/* Fill creature list */
  FillEsmCreatureCombo(m_CreatureList, true, true);

	/* Update the UI data */
  SetControlData();
 }
Beispiel #26
0
int EDirectory::ChangeDir(ExState &State) {
    char Dir[MAXPATH];
    char Dir2[MAXPATH];

    if (State.GetStrParam(View, Dir, sizeof(Dir)) == 0) {
        strcpy(Dir, Path);
        if (View->MView->Win->GetStr("Set directory", sizeof(Dir), Dir, HIST_PATH) == 0)
            return 0;
    }
    if (ExpandPath(Dir, Dir2, sizeof(Dir2)) == -1)
        return 0;
#if 0
    // is this needed for other systems as well ?
    Slash(Dir2, 1);
#endif
    if (Path)
        free(Path);
    Path = strdup(Dir2);
    Row = -1;
    UpdateTitle();
    return RescanDir();
}
Beispiel #27
0
C3DPlotFrame::C3DPlotFrame(wxFrame *parent, Project* project,
						   const std::vector<GeoDaVarInfo>& var_info,
						   const std::vector<int>& col_ids,
						   const wxString& title, const wxPoint& pos,
						   const wxSize& size, const long style)
	: TemplateFrame(parent, project, title, pos, size, style)
{
	m_splitter = new wxSplitterWindow(this);
    
	canvas = new C3DPlotCanvas(project, this,
							   project->GetHighlightState(),
							   var_info, col_ids,
							   m_splitter);
	
	control = new C3DControlPan(m_splitter, -1, wxDefaultPosition,
								wxDefaultSize, wxCAPTION|wxSYSTEM_MENU);
	control->template_frame = this;
	m_splitter->SplitVertically(control, canvas, 70);
	UpdateTitle();

	Show(true);
}
Beispiel #28
0
void MainFrame::UIUpdateAll()
{
   UIEnable(ID_EDIT_PASTE, m_view.CanPaste());
   UIEnable(ID_EDIT_UNDO, m_view.CanUndo());
   UIEnable(ID_EDIT_REDO, m_view.CanRedo());

   bool bSel = m_view.IsTextSelected();
   UIEnable(ID_EDIT_CUT, bSel);
   UIEnable(ID_EDIT_COPY, bSel);
   UIEnable(ID_EDIT_CLEAR, bSel);

   bool bModified = m_view.GetModify();

   UIEnable(ID_FILE_SAVE, bModified);
   UIEnable(ID_FILE_SAVE_AS, bModified);

   if (bModified != m_bScriptingFileModified)
   {
      m_bScriptingFileModified = bModified;
      UpdateTitle();
   }
}
Beispiel #29
0
nsresult
TaskbarTabPreview::Enable() {
  WNDCLASSW wc;
  HINSTANCE module = GetModuleHandle(nullptr);

  if (!GetClassInfoW(module, kWindowClass, &wc)) {
    wc.style         = 0;
    wc.lpfnWndProc   = GlobalWndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = module;
    wc.hIcon         = nullptr;
    wc.hCursor       = nullptr;
    wc.hbrBackground = (HBRUSH) nullptr;
    wc.lpszMenuName  = (LPCWSTR) nullptr;
    wc.lpszClassName = kWindowClass;
    RegisterClassW(&wc);
  }
  ::CreateWindowW(kWindowClass, L"TaskbarPreviewWindow",
                  WS_CAPTION | WS_SYSMENU, 0, 0, 200, 60,
                  nullptr, nullptr, module, this);
  // GlobalWndProc will set mProxyWindow so that WM_CREATE can have a valid HWND
  if (!mProxyWindow)
    return NS_ERROR_INVALID_ARG;

  UpdateProxyWindowStyle();

  nsresult rv = TaskbarPreview::Enable();
  nsresult rvUpdate;
  rvUpdate = UpdateTitle();
  if (NS_FAILED(rvUpdate))
    rv = rvUpdate;

  rvUpdate = UpdateIcon();
  if (NS_FAILED(rvUpdate))
    rv = rvUpdate;

  return rv;
}
ExploreFrame::ExploreFrame( wxWindow* parent ):
	BaseExploreFrame( parent ),
	m_archive(NULL)
{
	UpdateTitle();
#if defined(__WXMSW__)
	SetIcon(wxIcon("APPICON"));
#endif

	m_menubar->Enable(ID_EXTRACT, false);
	m_toolBar->EnableTool(ID_EXTRACT, false);
	m_menubar->Enable(wxID_SAVE, false);
	m_toolBar->EnableTool(wxID_SAVE, false);
	m_menubar->Enable(wxID_SAVEAS, false);
	m_ignoreSearch = true;

	m_toolBar->InsertStretchableSpace(5);
	m_toolBar->Realize();

	m_fileListCtrl->AppendTextColumn(_("Name"), 0, wxDATAVIEW_CELL_INERT, 250);
	m_fileListCtrl->AppendTextColumn(_("Size"), 1, wxDATAVIEW_CELL_INERT, -1, wxALIGN_RIGHT);

	m_fileHistory.UseMenu(m_fileMenu);
	{
		wxConfigPathChanger pathChanger(wxConfigBase::Get(), "/FileHistory/PatchFiles/");
		m_fileHistory.Load(*wxConfigBase::Get());
	}

	m_previewBookCtrl->AddPage(new wxPanel(m_previewBookCtrl), "General", true);
	m_previewBookCtrl->AddPage(new ImagePanel(m_previewBookCtrl), "Image", false);
	m_previewBookCtrl->AddPage(new TexturePackPanel(m_previewBookCtrl), "Texture", false);
	m_previewBookCtrl->AddPage(new TextPanel(m_previewBookCtrl), "Text", false);
	m_previewBookCtrl->AddPage(new StringTablePanel(m_previewBookCtrl), "String Table", false);

	Bind(wxEVT_MENU, &ExploreFrame::OnRecentFileClicked, this, wxID_FILE1, wxID_FILE9);

	wxPersistenceManager::Get().RegisterAndRestore(this);
}