mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-20 04:48:48 +08:00
Added wxFileHistory
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
%import gdi.i
|
||||
%import events.i
|
||||
%import streams.i
|
||||
%import utils.i
|
||||
|
||||
%{
|
||||
static wxString wxPyEmptyStr("");
|
||||
@@ -1277,6 +1278,42 @@ extern wxMimeTypesManager* wxTheMimeTypesManager;
|
||||
%}
|
||||
%readwrite
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
%{
|
||||
#include <wx/docview.h>
|
||||
%}
|
||||
|
||||
class wxFileHistory : public wxObject
|
||||
{
|
||||
public:
|
||||
wxFileHistory(int maxFiles = 9);
|
||||
~wxFileHistory();
|
||||
|
||||
// Operations
|
||||
void AddFileToHistory(const wxString& file);
|
||||
void RemoveFileFromHistory(int i);
|
||||
int GetMaxFiles() const;
|
||||
void UseMenu(wxMenu *menu);
|
||||
|
||||
// Remove menu from the list (MDI child may be closing)
|
||||
void RemoveMenu(wxMenu *menu);
|
||||
|
||||
void Load(wxConfigBase& config);
|
||||
void Save(wxConfigBase& config);
|
||||
|
||||
void AddFilesToMenu();
|
||||
%name(AddFilesToSingleMenu)void AddFilesToMenu(wxMenu* menu);
|
||||
|
||||
// Accessors
|
||||
wxString GetHistoryFile(int i) const;
|
||||
|
||||
// A synonym for GetNoHistoryFiles
|
||||
int GetCount() const;
|
||||
int GetNoHistoryFiles() const;
|
||||
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,8 @@ from clip_dnd import *
|
||||
from events import *
|
||||
|
||||
from streams import *
|
||||
|
||||
from utils import *
|
||||
class wxToolTipPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
@@ -916,6 +918,59 @@ class wxMimeTypesManager(wxMimeTypesManagerPtr):
|
||||
|
||||
|
||||
|
||||
class wxFileHistoryPtr(wxObjectPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def __del__(self,misc2c=misc2c):
|
||||
if self.thisown == 1 :
|
||||
misc2c.delete_wxFileHistory(self)
|
||||
def AddFileToHistory(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_AddFileToHistory,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def RemoveFileFromHistory(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_RemoveFileFromHistory,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetMaxFiles(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_GetMaxFiles,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def UseMenu(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_UseMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def RemoveMenu(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_RemoveMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Load(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_Load,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Save(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_Save,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def AddFilesToMenu(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_AddFilesToMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def AddFilesToSingleMenu(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_AddFilesToSingleMenu,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetHistoryFile(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_GetHistoryFile,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetCount(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_GetCount,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetNoHistoryFiles(self, *_args, **_kwargs):
|
||||
val = apply(misc2c.wxFileHistory_GetNoHistoryFiles,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxFileHistory instance at %s>" % (self.this,)
|
||||
class wxFileHistory(wxFileHistoryPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(misc2c.new_wxFileHistory,_args,_kwargs)
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-------------- FUNCTION WRAPPERS ------------------
|
||||
|
||||
Reference in New Issue
Block a user