GUI fixes

* Fixed log window docking
* Fixed multi-selection in the game list
* Fixed last filename selection.  Dolphin remembers the last game/elf/file that you loaded and will load that if you press the Play button without a default ISO selected and without selecting anything from the game list.



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4887 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2010-01-19 13:43:51 +00:00
parent f60c3e8445
commit c0a86df00e
4 changed files with 29 additions and 4 deletions

View File

@ -806,10 +806,6 @@ void CFrame::OnMotion(wxMouseEvent& event)
#if wxUSE_TIMER
void CFrame::Update()
{
// Update the GUI while a game has not yet been loaded
if (!Core::isRunning())
UpdateGUI();
// Check if auto hide is on, or if we are already hiding the cursor all the time
if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bAutoHideCursor
|| SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor) return;

View File

@ -1067,6 +1067,14 @@ void CFrame::UpdateGUI()
m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
}
// Prepare to load last selected file, enable play button
else if (!SConfig::GetInstance().m_LastFilename.empty()
&& wxFileExists(wxString(SConfig::GetInstance().m_LastFilename.c_str(), wxConvUTF8)))
{
if (m_ToolBar)
m_ToolBar->EnableTool(IDM_PLAY, true);
GetMenuBar()->FindItem(IDM_PLAY)->Enable(true);
}
else
{
// No game has been selected yet, disable play button

View File

@ -33,6 +33,7 @@
#include "FileUtil.h"
#include "CDUtils.h"
#include "WxUtils.h"
#include "main.h"
#if USE_XPM_BITMAPS
#include "../resources/Flag_Europe.xpm"
@ -99,6 +100,7 @@ END_EVENT_TABLE()
BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
EVT_SIZE(CGameListCtrl::OnSize)
EVT_RIGHT_DOWN(CGameListCtrl::OnRightClick)
// EVT_LEFT_DOWN(CGameListCtrl::OnLeftClick) // Disabled as stops multi-selection in the game list
EVT_LIST_KEY_DOWN(LIST_CTRL, CGameListCtrl::OnKeyPress)
EVT_MOTION(CGameListCtrl::OnMouseMotion)
EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, CGameListCtrl::OnColBeginDrag)
@ -779,6 +781,24 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
event.Skip();
}
void CGameListCtrl::OnLeftClick(wxMouseEvent& event)
{
// Focus the clicked item.
int flags;
long item = HitTest(event.GetPosition(), flags);
if (item != wxNOT_FOUND)
{
if (GetItemState(item, wxLIST_STATE_SELECTED) != wxLIST_STATE_SELECTED)
{
UnselectAll();
SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
}
SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
}
wxGetApp().GetCFrame()->UpdateGUI();
}
void CGameListCtrl::OnRightClick(wxMouseEvent& event)
{
// Focus the clicked item.

View File

@ -89,6 +89,7 @@ private:
DECLARE_EVENT_TABLE()
// events
void OnLeftClick(wxMouseEvent& event);
void OnRightClick(wxMouseEvent& event);
void OnMouseMotion(wxMouseEvent& event);
void OnColumnClick(wxListEvent& event);