2 * Copyright (c) 1999-2000, Eric Moon.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions, and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions, and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #include "TipWindow.h"
39 __USE_CORTEX_NAMESPACE
41 // -------------------------------------------------------- //
43 // -------------------------------------------------------- //
45 TipWindow::~TipWindow() {}
51 B_NO_BORDER_WINDOW_LOOK
,
52 B_FLOATING_ALL_WINDOW_FEEL
,
53 B_NOT_MOVABLE
|B_AVOID_FOCUS
/*,
55 // the TipView is created on demand
63 // -------------------------------------------------------- //
64 // *** operations (LOCK REQUIRED)
65 // -------------------------------------------------------- //
67 const char* TipWindow::text() const {
68 return m_text
.Length() ?
73 void TipWindow::setText(
80 m_tipView
->setText(text
);
84 m_tipView
->GetPreferredSize(&width
, &height
);
85 m_tipView
->ResizeTo(width
, height
);
86 ResizeTo(width
, height
);
88 m_tipView
->Invalidate();
91 // -------------------------------------------------------- //
93 // -------------------------------------------------------- //
95 // override to substitute your own view class
96 TipView
* TipWindow::createTipView() {
100 // -------------------------------------------------------- //
102 // -------------------------------------------------------- //
104 // initializes the tip view
105 void TipWindow::Show() {
107 // initialize the tip view if necessary
114 // remove tip view? +++++
115 void TipWindow::Hide() {
120 // hides the window when the user switches workspaces
121 // +++++ should it be restored when the user switches back?
122 void TipWindow::WorkspaceActivated(
126 // don't confuse the user
130 _inherited::WorkspaceActivated(workspace
, active
);
133 // -------------------------------------------------------- //
135 // -------------------------------------------------------- //
137 void TipWindow::_createTipView() {
140 m_tipView
= createTipView();
146 m_tipView
->setText(m_text
.String());
148 m_tipView
->setText("(no info)");
151 void TipWindow::_destroyTipView() {
154 RemoveChild(m_tipView
);
159 // END -- TipWindow.cpp --