/[projects]/wxCpuThrottle/src/trayicon.cpp
ViewVC logotype

Diff of /wxCpuThrottle/src/trayicon.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 24 by torben, Thu Aug 9 17:14:40 2007 UTC revision 25 by torben, Fri Aug 10 18:12:36 2007 UTC
# Line 63  wxMenu* TrayIcon::CreatePopupMenu() Line 63  wxMenu* TrayIcon::CreatePopupMenu()
63          menu->AppendSeparator();          menu->AppendSeparator();
64          menu->Append(Menu_Quit, wxT("Quit application"), wxT("Terminates wxCpuThrottle") );          menu->Append(Menu_Quit, wxT("Quit application"), wxT("Terminates wxCpuThrottle") );
65                    
66            if (!mParent->GetWritable())
67            {
68                    menu->Enable(Menu_Increase, false);
69                    menu->Enable(Menu_Decrease, false);
70            }
71                    
72          return menu;          return menu;
73  }  }
74    
75  void TrayIcon::OnQuit( wxCommandEvent& event )  void TrayIcon::OnQuit( wxCommandEvent& event )
76  {  {
77          mParent->OnQuit(event);          mParent->OnQuit(/*event*/);
78  }  }
79    
80    
# Line 81  void TrayIcon::OnAbout( wxCommandEvent& Line 86  void TrayIcon::OnAbout( wxCommandEvent&
86    
87  void TrayIcon::OnShowDialog( wxCommandEvent& event )  void TrayIcon::OnShowDialog( wxCommandEvent& event )
88  {  {
89          mParent->SetPosition();          ShowDialog();
         mParent->Show( !mParent->IsShown() );  
90  }  }
91    
92  void TrayIcon::OnLeftClick(wxTaskBarIconEvent& WXUNUSED(event) )  void TrayIcon::OnLeftClick(wxTaskBarIconEvent& WXUNUSED(event) )
93  {  {
94          mParent->SetPosition();          ShowDialog();
         mParent->Show( !mParent->IsShown() );  
95  }  }
96    
97  void TrayIcon::OnIncrease( wxCommandEvent& WXUNUSED( event ) )  void TrayIcon::OnIncrease( wxCommandEvent& WXUNUSED( event ) )
98  {  {
99  }                        AcpiParser* parser = mParent->GetParser();
100            int current = parser->GetCurrentState();
101            
102            if (current < parser->GetStateCount() -1)
103                    parser->SetState( current +1 );
104    }
105                    
106  void TrayIcon::OnDecrease( wxCommandEvent& WXUNUSED( event ) )  void TrayIcon::OnDecrease( wxCommandEvent& WXUNUSED( event ) )
107  {  {
108            AcpiParser* parser = mParent->GetParser();
109            int current = parser->GetCurrentState();
110                            
111            if ( current > 0)
112                    parser->SetState( current - 1 );
113    }
114    
115    
116    
117    void TrayIcon::ShowDialog()
118    {
119            mParent->SetPosition();
120            mParent->Show( !mParent->IsShown() );
121            
122            if (mParent->IsIconized())
123                    mParent->Iconize( false );
124  }  }

Legend:
Removed from v.24  
changed lines
  Added in v.25

  ViewVC Help
Powered by ViewVC 1.1.20