Pyro higlevel API
|
Generic file requester. More...
Classes | |
class | Private |
Public Types | |
enum | file_req_mode_t { LOAD_REQ, SAVE_REQ } |
enum | { NODE_FILE = 0x01, NODE_DIR = 0x02 } |
Public Member Functions | |
FileRequester (file_req_mode_t nMode=LOAD_REQ, Messenger *pcTarget=NULL, String cStartPath="", uint32 nNodeType=NODE_FILE, bool bMultiSelect=true, Message *pcMessage=NULL, FileFilter *pcFilter=NULL, bool bModal=false, bool bHideWhenDone=true, String cOkLabel="", String cCancelLabel="") | |
Constructor. More... | |
virtual | ~FileRequester () |
void | Show (bool bMakeVisible=true) |
virtual void | HandleMessage (Message *pcMessage) |
Handle a message targeted at this handler. More... | |
virtual void | FrameSized (const Point &cDelta) |
virtual bool | OkToQuit (void) |
Check if it is ok to break the loop. More... | |
void | SetPath (const String &cPath) |
Sets a new path. More... | |
String | GetPath () const |
Returns the current path. More... | |
Public Member Functions inherited from os::Window | |
Window (const Rect &cFrame, const String &cName, const String &cTitle, uint32 nFlags=0, uint32 nDesktopMask=CURRENT_DESKTOP) | |
Initialize the window. More... | |
~Window () | |
Destruct a window. More... | |
virtual void | FrameMoved (const Point &cDelta) |
virtual void | ScreenModeChanged (const IPoint &cNewRes, color_space eColorSpace) |
Called whenever the screenmode changes. More... | |
virtual void | DesktopActivated (int nDesktop, bool bActive) |
Called whenever the desktop displaying the window will be activated or deactivated. More... | |
virtual void | DesktopsChanged (uint32 nOldDesktops, uint32 nNewDesktops) |
virtual void | WindowsChanged () |
Called whenever the currently shown windows change. More... | |
void | SetFlags (uint32 nFlags) |
uint32 | GetFlags () const |
void | SetSizeLimits (const Point &cMinSize, const Point &cMaxSize) |
Limit the minimum and maximum window size. More... | |
void | SetAlignment (const IPoint &cSize=IPoint(1, 1), const IPoint &cSizeOffset=IPoint(0, 0), const IPoint &cPos=IPoint(1, 1), const IPoint &cPosOffset=IPoint(0, 0)) |
void | AddChild (View *pcChild, bool bAssignTabOrder=false) |
Add a view to the window. More... | |
void | RemoveChild (View *pcChild) |
Remove a view from the window. More... | |
void | MakeFocus (bool bFocus=true) |
Activate/Deactivate the window. More... | |
void | Close () |
void | Show (bool bMakeVisible=true) |
Hide/Unhide the window. More... | |
void | Hide () |
bool | IsVisible () const |
void | Start () |
Unlock the window and start the looper thread. More... | |
void | SetTitle (const String &cTitle) |
Change the window title. More... | |
String | GetTitle (void) const |
Obtain the current window title. More... | |
void | SetIcon (Bitmap *pcIcon) |
Change the window icon. More... | |
Bitmap * | GetIcon (void) const |
Not longer supported. More... | |
void | Flush () |
Flush the windows render queue. More... | |
void | Sync () |
Flush the render queue, and wait til the rendering is done. More... | |
View * | FindView (const String &cName) const |
View * | FindView (const Point &cPos) const |
Find the view covering a given position on the window. More... | |
View * | GetFocusChild (void) const |
View * | SetFocusChild (View *pcChild) |
Activate a view. More... | |
void | SetDefaultButton (View *pcView) |
Assign a default button. More... | |
View * | GetDefaultButton () const |
Return the view assigned as the default button. More... | |
void | SetDefaultWheelView (View *pcView) |
View * | GetDefaultWheelView () const |
Rect | GetFrame () const |
Get the windows position and size on the current desktop. More... | |
Rect | GetBounds () const |
Get the window boundary. More... | |
void | SetFrame (const Rect &cRect, bool bNotifyServer=true) |
Set the window's position and size. More... | |
void | MoveBy (const Point &cDelta) |
Move the window relative to it's current position. More... | |
void | MoveBy (float vDeltaX, float vDeltaY) |
Move the window relative to it's current position. More... | |
void | MoveTo (const Point &cPos) |
Move the window to an absolute position. More... | |
void | MoveTo (float x, float y) |
Move the window to an absolute position. More... | |
void | CenterInWindow (Window *pcWin) |
Move the window to the centre of another window. More... | |
void | CenterInScreen () |
Move the window to the center of the screen. More... | |
void | ResizeBy (const Point &cDelta) |
Resize the window relative to it's current size. More... | |
void | ResizeBy (float vDeltaW, float vDeltaH) |
Resize the window relative to it's current size. More... | |
void | ResizeTo (const Point &cSize) |
Resize the window to a new absolute size. More... | |
void | ResizeTo (float w, float h) |
Resize the window to a new absolute size. More... | |
void | SetShapeRegion (const Region &cReg) |
void | ClearShapeRegion () |
bool | IsActive () const |
int | ToggleDepth () |
void | AddShortcut (const ShortcutKey &cKey, Message *pcMsg) |
Add a keyboard shortcut. More... | |
void | AddShortcut (const ShortcutKey &cKey, View *pcView) |
Add a keyboard shortcut. More... | |
void | RemoveShortcut (const ShortcutKey &cKey) |
Remove a keyboard shortcut. More... | |
void | DispatchMessage (Message *pcMessage, Handler *pcHandler) |
The loopers message handling callback. More... | |
Public Member Functions inherited from os::Looper | |
Looper (const String &cName, int nPriority=NORMAL_PRIORITY, int nPortSize=DEFAULT_PORT_SIZE) | |
The looper constructor. More... | |
virtual | ~Looper () |
Looper destructor. More... | |
void | SetName (const String &cName) |
Rename the looper. More... | |
String | GetName () const |
Get the loopers name. More... | |
bool | IsPublic () const |
See if the looper's message port is public. More... | |
void | SetPublic (bool bPublic) |
Make port public/private. More... | |
port_id | GetMsgPort () const |
Obtain the low-level message port used by this looper. More... | |
thread_id | GetThread () const |
Obtain the thread id of the looper thread. More... | |
proc_id | GetProcess () const |
Obtain the process ID of the loopers thread. More... | |
status_t | Lock () |
Lock the looper object. More... | |
status_t | Lock (bigtime_t nTimeout) |
Lock the looper with a timeout. More... | |
status_t | SafeLock () |
Attempt to lock the looper. More... | |
status_t | Unlock () |
Unlock the looper. More... | |
void | SetMutex (Locker *pcMutex) |
Set a custom mutex to be used by the looper. More... | |
Locker * | GetMutex () const |
Get a pointer to the loopers mutex. More... | |
int | GetLockCount () const |
Obtain the number of locks held on the looper. More... | |
thread_id | GetLockingThread () const |
Obtaing the owner of the looper lock. More... | |
bool | IsLocked () const |
Check if the looper lock is owned by the calling thread. More... | |
virtual thread_id | Run () |
Start and unlock the looper. More... | |
int | Wait () const |
Wait for the looper thread to die. More... | |
status_t | PostMessage (uint32 nCode) |
Deliver a message to the looper. More... | |
status_t | PostMessage (Message *pcMsg) |
Deliver a message to the looper. More... | |
status_t | PostMessage (uint32 cCode, Handler *pcHandler, Handler *pcReplyTo=NULL) |
Deliver a message to the looper. More... | |
status_t | PostMessage (Message *pcMsg, Handler *pcHandler, Handler *pcReplyTo=NULL) |
Deliver a message to the looper. More... | |
void | SpoolMessages () |
Drain the low-level message port. More... | |
Message * | GetCurrentMessage () const |
Obtain the message currently being processed. More... | |
Message * | DetachCurrentMessage () |
Steal the current message. More... | |
virtual void | Started () |
Called by the looper thread before entering the message loop. More... | |
virtual bool | Idle () |
Hook called each time the message queue is drained. More... | |
MessageQueue * | GetMessageQueue () const |
Obtain the internal message queue used by the looper. More... | |
virtual void | Quit () |
Unconditionally terminate the looper. More... | |
void | Terminate () |
Unconditionally terminate the looper. More... | |
void | AddTimer (Handler *pcTarget, int nID, bigtime_t nTimeout, bool bOneShot=true) |
Add a timer to the looper. More... | |
bool | RemoveTimer (Handler *pcTarget, int nID) |
Delete a timer. More... | |
const handler_map & | GetHandlerMap () const |
Get the internal handler list. More... | |
void | AddHandler (Handler *pcHandler) |
Add a handler to the looper. More... | |
bool | RemoveHandler (Handler *pcHandler) |
Remove a handler previously added by AddHandler() More... | |
Handler * | FindHandler (const String &cName) const |
Search the looper for a named handler. More... | |
int | GetHandlerCount () const |
Obtain the count of handlers added to this looper. More... | |
void | SetDefaultHandler (Handler *pcHandler) |
Set the default target for incomming messages. More... | |
Handler * | GetDefaultHandler () const |
Obtain the default handler for the looper. More... | |
void | AddCommonFilter (MessageFilter *pcFilter) |
void | RemoveCommonFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetCommonFilterList () const |
Public Member Functions inherited from os::Handler | |
Handler (const String &cName) | |
Construct a handler. More... | |
virtual | ~Handler () |
Destructor. More... | |
virtual void | TimerTick (int nID) |
Timer dispatch member. More... | |
String | GetName () const |
Get the handlers name. More... | |
void | SetName (const String &cName) |
Rename the handler. More... | |
Looper * | GetLooper () const |
Get a pointer to the looper this handler belongs to. More... | |
void | SetNextHandler (Handler *pcNextHandler) |
Set a handler that should handle messages this handler is not interrested in. More... | |
Handler * | GetNextHandler () const |
Get the next handler in a handler chain. More... | |
void | AddFilter (MessageFilter *pcFilter) |
void | RemoveFilter (MessageFilter *pcFilter) |
const MsgFilterList & | GetFilterList () const |
const uint32 | GetToken () |
Get the handlers token. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from os::Looper | |
static Looper * | GetLooperForThread (thread_id hThread) |
Protected Member Functions inherited from os::Looper | |
bool | FilterMessage (Message *pcMsg, Handler **ppcTarget, std::list< MessageFilter * > *pcFilterList) |
FileRequester::FileRequester | ( | file_req_mode_t | nMode = LOAD_REQ , |
Messenger * | pcTarget = NULL , |
||
String | cStartPath = "" , |
||
uint32 | nNodeType = NODE_FILE , |
||
bool | bMultiSelect = true , |
||
Message * | pcMessage = NULL , |
||
FileFilter * | pcFilter = NULL , |
||
bool | bModal = false , |
||
bool | bHideWhenDone = true , |
||
String | cOkLabel = "" , |
||
String | cCancelLabel = "" |
||
) |
nMode | - Whether the filerequester is used to load or save files. |
zName | - The target of the messages. |
pzStartPath | - The start path. Default is the home directory of the user. |
nNodeType | - When NODE_DIR is given, also directories can be opened. |
bMultiSelect | - Whether multiple files can be selected. |
pcMessage | - A message which overrieds M_LOAD_REQUESTED/M_SAVE_REQUESTED. |
pcFilter | - A file filter. NOT SUPPORTED YET. |
bModal | - NOT SUPPORTED YET. |
bHideWhenDone | - NOT SUPPORTED YET. |
cOKLabel | - Overrides "Load" or "Save". |
cCancelLabel | - Overrides "Cancel". |
References os::LayoutNode::AddChild(), os::Window::AddChild(), os::Window::AddShortcut(), os::DropdownMenu::AppendItem(), os::String::c_str(), os::String::empty(), os::Application::GetApplicationLocale(), os::Window::GetBounds(), os::Application::GetInstance(), os::Locale::GetLocalizedSystemCatalog(), os::IconDirectoryView::GetPath(), os::Catalog::GetString(), os::ImageButton::IB_TEXT_BOTTOM, os::DropdownMenu::InsertItem(), LOAD_REQ, os::Looper::Lock(), os::FileRequester::Private::m_bHideWhenDone, os::FileRequester::Private::m_cBackStack, os::FileRequester::Private::m_nMode, os::FileRequester::Private::m_nNodeType, os::FileRequester::Private::m_pcBackButton, os::FileRequester::Private::m_pcCancelButton, os::FileRequester::Private::m_pcCatalog, os::FileRequester::Private::m_pcDirView, os::FileRequester::Private::m_pcFileString, os::FileRequester::Private::m_pcHomeButton, os::FileRequester::Private::m_pcMessage, os::FileRequester::Private::m_pcOkButton, os::FileRequester::Private::m_pcPathView, os::FileRequester::Private::m_pcRoot, os::FileRequester::Private::m_pcTarget, os::FileRequester::Private::m_pcTypeDrop, os::FileRequester::Private::m_pcUpButton, os::IconView::MakeFocus(), os::Handler::Message, os::Looper::Messenger, NODE_FILE, os::IconDirectoryView::SetAutoLaunch(), os::LayoutNode::SetBorders(), os::Window::SetDefaultButton(), os::IconDirectoryView::SetDirChangeMsg(), os::Control::SetEnable(), os::Window::SetFrame(), os::ImageButton::SetImage(), os::IconView::SetInvokeMsg(), os::DropdownMenu::SetMaxPreferredSize(), os::IconView::SetMultiSelect(), os::DropdownMenu::SetReadOnly(), os::LayoutView::SetRoot(), os::IconView::SetSelChangeMsg(), os::DropdownMenu::SetSelection(), os::DropdownMenu::SetSelectionMessage(), os::Invoker::SetTarget(), os::Window::SetTitle(), os::IconView::SetView(), os::Looper::Unlock(), and os::IconView::VIEW_DETAILS.
|
virtual |
|
virtual |
Reimplemented from os::Window.
String FileRequester::GetPath | ( | ) | const |
References os::IconDirectoryView::GetPath(), and os::FileRequester::Private::m_pcDirView.
Referenced by SetPath().
|
virtual |
pcMessage
is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage(). pcMessage | The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(), |
Reimplemented from os::Handler.
References os::Message::AddPointer(), os::Message::AddString(), os::Alert::ALERT_WARNING, os::Path::Append(), os::String::c_str(), os::Window::CenterInWindow(), os::Message::FindInt32(), os::String::Format(), os::TextView::GetBuffer(), os::Message::GetCode(), os::FileRequester::Private::GetFirstDirectory(), os::IconView::GetIconCount(), os::IconView::GetIconData(), os::IconView::GetIconSelected(), os::IconView::GetIconString(), os::DropdownMenu::GetItem(), os::Path::GetPath(), os::IconDirectoryView::GetPath(), os::DropdownMenu::GetSelection(), os::Catalog::GetString(), os::Alert::Go(), os::Handler::HandleMessage(), LOAD_REQ, os::FileRequester::Private::m_cBackStack, os::M_FILE_REQUESTER_CANCELED, os::M_LOAD_REQUESTED, os::FileRequester::Private::m_nMode, os::FileRequester::Private::m_nNodeType, os::FileRequester::Private::m_pcCatalog, os::FileRequester::Private::m_pcDirView, os::FileRequester::Private::m_pcMessage, os::FileRequester::Private::m_pcPathView, os::FileRequester::Private::m_pcTarget, os::FileRequester::Private::m_pcTypeDrop, os::M_SAVE_REQUESTED, os::DirectoryIconData::m_sStat, os::DirectoryIconData::m_zPath, os::IconView::MakeFocus(), os::Handler::Message, NODE_DIR, NODE_FILE, os::FileRequester::Private::PathChanged(), os::IconDirectoryView::ReRead(), os::Messenger::SendMessage(), os::TextView::Set(), SetPath(), os::IconDirectoryView::SetPath(), and Show().
|
virtual |
Reimplemented from os::Looper.
References os::Message::AddPointer(), os::M_FILE_REQUESTER_CANCELED, os::FileRequester::Private::m_pcTarget, os::Handler::Message, os::Messenger::SendMessage(), and Show().
void FileRequester::SetPath | ( | const String & | cNewPath | ) |
cNewPath | - The new path. |
References os::String::c_str(), GetPath(), os::FileRequester::Private::m_nNodeType, os::FileRequester::Private::m_pcDirView, os::FileRequester::Private::m_pcPathView, os::IconView::MakeFocus(), NODE_FILE, os::IconDirectoryView::ReRead(), os::TextView::Set(), and os::IconDirectoryView::SetPath().
Referenced by HandleMessage().
void FileRequester::Show | ( | bool | bMakeVisible = true | ) |
References os::FileRequester::Private::m_bFirstReread, os::FileRequester::Private::m_pcDirView, os::IconDirectoryView::ReRead(), and os::Window::Show().
Referenced by HandleMessage(), and OkToQuit().