Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21304 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2006, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -33,9 +33,9 @@ DirectoryRefFilter::Filter(const entry_ref *ref, BNode* node, struct stat *st,
|
||||
|
||||
|
||||
DirectoryFilePanel::DirectoryFilePanel(file_panel_mode mode, BMessenger *target,
|
||||
const entry_ref *startDirectory, uint32 nodeFlavors,
|
||||
bool allowMultipleSelection, BMessage *message, BRefFilter *filter,
|
||||
bool modal, bool hideWhenDone)
|
||||
const entry_ref *startDirectory, uint32 nodeFlavors,
|
||||
bool allowMultipleSelection, BMessage *message, BRefFilter *filter,
|
||||
bool modal, bool hideWhenDone)
|
||||
: BFilePanel(mode, target, startDirectory, nodeFlavors,
|
||||
allowMultipleSelection, message, filter, modal, hideWhenDone),
|
||||
fCurrentButton(NULL)
|
||||
@@ -60,13 +60,13 @@ DirectoryFilePanel::Show()
|
||||
rect.top = rect.bottom - 35;
|
||||
rect.bottom -= 10;
|
||||
}
|
||||
|
||||
|
||||
rect.right = rect.left -= 30;
|
||||
float directory_width = be_plain_font->StringWidth("Select current") + 20;
|
||||
rect.left = (directory_width > 75) ? (rect.right - directory_width) : (rect.right - 75);
|
||||
float width = be_plain_font->StringWidth("Select current") + 20;
|
||||
rect.left = width > 75 ? rect.right - width : rect.right - 75;
|
||||
fCurrentButton = new BButton(rect, "directoryButton", "Select current",
|
||||
new BMessage(MSG_DIRECTORY), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||
|
||||
|
||||
background->AddChild(fCurrentButton);
|
||||
fCurrentButton->SetTarget(Messenger());
|
||||
|
||||
@@ -81,7 +81,7 @@ DirectoryFilePanel::Show()
|
||||
|
||||
|
||||
void
|
||||
DirectoryFilePanel::SelectionChanged(void)
|
||||
DirectoryFilePanel::SelectionChanged()
|
||||
{
|
||||
Window()->Lock();
|
||||
|
||||
|
||||
@@ -1,36 +1,18 @@
|
||||
/*****************************************************************************/
|
||||
// Expander
|
||||
// Written by Jérôme Duval
|
||||
//
|
||||
// DirectoryFilePanel.h
|
||||
//
|
||||
// Copyright (c) 2004 OpenBeOS Project
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
/*****************************************************************************/
|
||||
/*
|
||||
* Copyright 2004-2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Jérôme Duval
|
||||
*/
|
||||
#ifndef _DIRECTORY_FILE_PANEL_H
|
||||
#define _DIRECTORY_FILE_PANEL_H
|
||||
|
||||
#ifndef _DirectoryFilePanel_h
|
||||
#define _DirectoryFilePanel_h
|
||||
|
||||
#include <FilePanel.h>
|
||||
#include <Button.h>
|
||||
|
||||
|
||||
const uint32 MSG_DIRECTORY = 'mDIR';
|
||||
|
||||
|
||||
@@ -41,20 +23,21 @@ class DirectoryRefFilter : public BRefFilter {
|
||||
const char *filetype);
|
||||
};
|
||||
|
||||
|
||||
class DirectoryFilePanel : public BFilePanel {
|
||||
public:
|
||||
DirectoryFilePanel(file_panel_mode mode = B_OPEN_PANEL,
|
||||
BMessenger *target = 0, const entry_ref *start_directory = 0,
|
||||
uint32 node_flavors = 0, bool allow_multiple_selection = true,
|
||||
BMessage *message = 0, BRefFilter * = 0,
|
||||
bool modal = false, bool hide_when_done = true);
|
||||
BMessenger *target = NULL, const entry_ref *startDirectory = NULL,
|
||||
uint32 nodeFlavors = 0, bool allowMultipleSelection = true,
|
||||
BMessage *message = NULL, BRefFilter *filter = NULL,
|
||||
bool modal = false, bool hideWhenDone = true);
|
||||
virtual ~DirectoryFilePanel() {};
|
||||
virtual void SelectionChanged(void);
|
||||
|
||||
virtual void SelectionChanged();
|
||||
virtual void Show();
|
||||
// overrides non-virtual BFilePanel::Show()
|
||||
|
||||
protected:
|
||||
BButton *fCurrentButton;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // _DIRECTORY_FILE_PANEL_H
|
||||
|
||||
Reference in New Issue
Block a user