1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef DBAUI_TABLEFIELDDESCRIPTION_HXX
32*cdf0e10cSrcweir #include "TableFieldDescWin.hxx"
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir #ifndef _TOOLS_DEBUG_HXX
35*cdf0e10cSrcweir #include <tools/debug.hxx>
36*cdf0e10cSrcweir #endif
37*cdf0e10cSrcweir #ifndef DBAUI_FIELDDESCRIPTIONS_HXX
38*cdf0e10cSrcweir #include "FieldDescriptions.hxx"
39*cdf0e10cSrcweir #endif
40*cdf0e10cSrcweir #ifndef _DBU_TBL_HRC_
41*cdf0e10cSrcweir #include "dbu_tbl.hrc"
42*cdf0e10cSrcweir #endif
43*cdf0e10cSrcweir #ifndef DBAUI_FIELDDESCRIPTIONS_HXX
44*cdf0e10cSrcweir #include "FieldDescriptions.hxx"
45*cdf0e10cSrcweir #endif
46*cdf0e10cSrcweir #ifndef DBAUI_TABLEDESIGNHELPBAR_HXX
47*cdf0e10cSrcweir #include "TableDesignHelpBar.hxx"
48*cdf0e10cSrcweir #endif
49*cdf0e10cSrcweir #ifndef _SV_FIXED_HXX
50*cdf0e10cSrcweir #include <vcl/fixed.hxx>
51*cdf0e10cSrcweir #endif
52*cdf0e10cSrcweir #ifndef _DBA_DBACCESS_HELPID_HRC_
53*cdf0e10cSrcweir #include "dbaccess_helpid.hrc"
54*cdf0e10cSrcweir #endif
55*cdf0e10cSrcweir #ifndef _DBAUI_MODULE_DBU_HXX_
56*cdf0e10cSrcweir #include "moduledbu.hxx"
57*cdf0e10cSrcweir #endif
58*cdf0e10cSrcweir #include <memory>
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir #define STANDARD_MARGIN					 6
61*cdf0e10cSrcweir #define DETAILS_HEADER_HEIGHT			25
62*cdf0e10cSrcweir #define CONTROL_SPACING_X	18	// 6
63*cdf0e10cSrcweir #define	CONTROL_SPACING_Y	5
64*cdf0e10cSrcweir #define CONTROL_HEIGHT		20
65*cdf0e10cSrcweir #define CONTROL_WIDTH_1		140	// 100
66*cdf0e10cSrcweir #define CONTROL_WIDTH_2		100 // 60
67*cdf0e10cSrcweir #define CONTROL_WIDTH_3		250
68*cdf0e10cSrcweir #define CONTROL_WIDTH_4		(CONTROL_WIDTH_3 - CONTROL_HEIGHT - 5)
69*cdf0e10cSrcweir #define DETAILS_OPT_PAGE_WIDTH			(CONTROL_WIDTH_1 + CONTROL_SPACING_X + CONTROL_WIDTH_4 + 50)
70*cdf0e10cSrcweir #define DETAILS_OPT_PAGE_HEIGHT			((CONTROL_HEIGHT + CONTROL_SPACING_Y) * 5)
71*cdf0e10cSrcweir #define DETAILS_MIN_HELP_WIDTH			100
72*cdf0e10cSrcweir #define DETAILS_OPT_HELP_WIDTH			200
73*cdf0e10cSrcweir #define DETAILS_MIN_HELP_HEIGHT			50
74*cdf0e10cSrcweir #define DETAILS_OPT_HELP_HEIGHT			100
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir using namespace dbaui;
78*cdf0e10cSrcweir //==================================================================
79*cdf0e10cSrcweir // class OTableFieldDescWin
80*cdf0e10cSrcweir //==================================================================
81*cdf0e10cSrcweir DBG_NAME(OTableFieldDescWin)
82*cdf0e10cSrcweir //------------------------------------------------------------------------------
83*cdf0e10cSrcweir OTableFieldDescWin::OTableFieldDescWin( Window* pParent)
84*cdf0e10cSrcweir 	:TabPage(pParent, WB_3DLOOK)
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir 	DBG_CTOR(OTableFieldDescWin,NULL);
87*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
88*cdf0e10cSrcweir 	// Header
89*cdf0e10cSrcweir 	m_pHeader = new FixedText( this, WB_CENTER | WB_INFO );	//  | WB_3DLOOK
90*cdf0e10cSrcweir 	m_pHeader->SetText( String(ModuleRes(STR_TAB_PROPERTIES)) );
91*cdf0e10cSrcweir 	m_pHeader->Show();
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
94*cdf0e10cSrcweir 	// HelpBar
95*cdf0e10cSrcweir 	m_pHelpBar = new OTableDesignHelpBar( this );
96*cdf0e10cSrcweir 	m_pHelpBar->SetHelpId(HID_TAB_DESIGN_HELP_TEXT_FRAME);
97*cdf0e10cSrcweir 	m_pHelpBar->Show();
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir 	m_pGenPage = new OFieldDescGenWin( this, m_pHelpBar );
100*cdf0e10cSrcweir 	getGenPage()->SetHelpId( HID_TABLE_DESIGN_TABPAGE_GENERAL );
101*cdf0e10cSrcweir 	getGenPage()->Show();
102*cdf0e10cSrcweir }
103*cdf0e10cSrcweir 
104*cdf0e10cSrcweir //------------------------------------------------------------------------------
105*cdf0e10cSrcweir OTableFieldDescWin::~OTableFieldDescWin()
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir 	DBG_DTOR(OTableFieldDescWin,NULL);
108*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
109*cdf0e10cSrcweir 	// Childs zerstoeren
110*cdf0e10cSrcweir 	m_pHelpBar->Hide();
111*cdf0e10cSrcweir 	getGenPage()->Hide();
112*cdf0e10cSrcweir 	m_pHeader->Hide();
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	{
115*cdf0e10cSrcweir 		::std::auto_ptr<Window> aTemp(m_pGenPage);
116*cdf0e10cSrcweir 		m_pGenPage = NULL;
117*cdf0e10cSrcweir 	}
118*cdf0e10cSrcweir 	{
119*cdf0e10cSrcweir 		::std::auto_ptr<Window> aTemp(m_pHeader);
120*cdf0e10cSrcweir 		m_pHeader = NULL;
121*cdf0e10cSrcweir 	}
122*cdf0e10cSrcweir 	{
123*cdf0e10cSrcweir 		::std::auto_ptr<Window> aTemp(m_pHelpBar);
124*cdf0e10cSrcweir 		m_pHelpBar = NULL;
125*cdf0e10cSrcweir 	}
126*cdf0e10cSrcweir }
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir //------------------------------------------------------------------------------
129*cdf0e10cSrcweir void OTableFieldDescWin::Init()
130*cdf0e10cSrcweir {
131*cdf0e10cSrcweir 	DBG_ASSERT(getGenPage() != NULL, "OTableFieldDescWin::Init : ups ... no GenericPage ... this will crash ...");
132*cdf0e10cSrcweir 	getGenPage()->Init();
133*cdf0e10cSrcweir }
134*cdf0e10cSrcweir 
135*cdf0e10cSrcweir //------------------------------------------------------------------------------
136*cdf0e10cSrcweir void OTableFieldDescWin::SetReadOnly( sal_Bool bRead )
137*cdf0e10cSrcweir {
138*cdf0e10cSrcweir 	DBG_CHKTHIS(OTableFieldDescWin,NULL);
139*cdf0e10cSrcweir 	getGenPage()->SetReadOnly( bRead );
140*cdf0e10cSrcweir }
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir //------------------------------------------------------------------------------
143*cdf0e10cSrcweir void OTableFieldDescWin::DisplayData( OFieldDescription* pFieldDescr )
144*cdf0e10cSrcweir {
145*cdf0e10cSrcweir 	DBG_CHKTHIS(OTableFieldDescWin,NULL);
146*cdf0e10cSrcweir 	getGenPage()->DisplayData( pFieldDescr );
147*cdf0e10cSrcweir }
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir //------------------------------------------------------------------------------
150*cdf0e10cSrcweir void OTableFieldDescWin::SaveData( OFieldDescription* pFieldDescr )
151*cdf0e10cSrcweir {
152*cdf0e10cSrcweir 	DBG_CHKTHIS(OTableFieldDescWin,NULL);
153*cdf0e10cSrcweir 	getGenPage()->SaveData( pFieldDescr );
154*cdf0e10cSrcweir }
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir //------------------------------------------------------------------------------
157*cdf0e10cSrcweir void OTableFieldDescWin::Paint( const Rectangle& /*rRect*/ )
158*cdf0e10cSrcweir {
159*cdf0e10cSrcweir 	DBG_CHKTHIS(OTableFieldDescWin,NULL);
160*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
161*cdf0e10cSrcweir 	// 3D-Linie am oberen Fensterrand
162*cdf0e10cSrcweir 	const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 	SetLineColor( rStyleSettings.GetLightColor() );
165*cdf0e10cSrcweir 	DrawLine( Point(0,0), Point(GetSizePixel().Width(),0) );
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
168*cdf0e10cSrcweir 	// 3D-Linie zum Abtrennen des Headers
169*cdf0e10cSrcweir 	DrawLine( Point(3, DETAILS_HEADER_HEIGHT), Point(GetSizePixel().Width()-6, DETAILS_HEADER_HEIGHT) );
170*cdf0e10cSrcweir 	SetLineColor( rStyleSettings.GetShadowColor() );
171*cdf0e10cSrcweir 	DrawLine( Point(3, DETAILS_HEADER_HEIGHT-1), Point(GetSizePixel().Width()-6, DETAILS_HEADER_HEIGHT-1) );
172*cdf0e10cSrcweir }
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir //------------------------------------------------------------------------------
175*cdf0e10cSrcweir void OTableFieldDescWin::Resize()
176*cdf0e10cSrcweir {
177*cdf0e10cSrcweir 	DBG_CHKTHIS(OTableFieldDescWin,NULL);
178*cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////
179*cdf0e10cSrcweir 	// Abmessungen parent window
180*cdf0e10cSrcweir 	Size aOutputSize( GetOutputSizePixel() );
181*cdf0e10cSrcweir 	long nOutputWidth = aOutputSize.Width();
182*cdf0e10cSrcweir 	long nOutputHeight = aOutputSize.Height();
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir 	// da die GenPage scrollen kann, ich selber aber nicht, positioniere ich das HelpFenster, wenn ich zu schmal werde,
185*cdf0e10cSrcweir 	// _unter_ der Genpage, nicht rechts daneben. Zuvor versuche ich aber noch, es etwas schmaler zu machen
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 	long nHelpX, nHelpY;
188*cdf0e10cSrcweir 	long nHelpWidth, nHelpHeight;
189*cdf0e10cSrcweir 	long nPageWidth, nPageHeight;
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 	// passen beide nebeneinander (Rand + Page + Rand + Help) ?
192*cdf0e10cSrcweir 	if (STANDARD_MARGIN + DETAILS_OPT_PAGE_WIDTH + STANDARD_MARGIN + DETAILS_MIN_HELP_WIDTH <= nOutputWidth)
193*cdf0e10cSrcweir 	{	// ja -> dann ist die Frage, ob man der Hilfe ihre Optimal-Breite geben kann
194*cdf0e10cSrcweir 		nHelpWidth = DETAILS_OPT_HELP_WIDTH;
195*cdf0e10cSrcweir 		nPageWidth = nOutputWidth - nHelpWidth - STANDARD_MARGIN - STANDARD_MARGIN;
196*cdf0e10cSrcweir 		if (nPageWidth < DETAILS_OPT_PAGE_WIDTH)
197*cdf0e10cSrcweir 		{	// dann doch lieber die Hilfe von ihrer optimalen in Richtung auf die minimale Groesse
198*cdf0e10cSrcweir 			long nTransfer = DETAILS_OPT_PAGE_WIDTH - nPageWidth;
199*cdf0e10cSrcweir 			nPageWidth += nTransfer;
200*cdf0e10cSrcweir 			nHelpWidth -= nTransfer;
201*cdf0e10cSrcweir 		}
202*cdf0e10cSrcweir 		nHelpX = nOutputWidth - nHelpWidth;
203*cdf0e10cSrcweir 		// die Hoehen sind dann einfach ...
204*cdf0e10cSrcweir 		nHelpY = DETAILS_HEADER_HEIGHT + 1;
205*cdf0e10cSrcweir 		nHelpHeight = nOutputHeight - nHelpY;
206*cdf0e10cSrcweir 		nPageHeight = nOutputHeight - STANDARD_MARGIN - DETAILS_HEADER_HEIGHT - STANDARD_MARGIN;
207*cdf0e10cSrcweir 	}
208*cdf0e10cSrcweir 	else
209*cdf0e10cSrcweir 	{	// nebeneinander geht nicht, also untereinander (Rand + Header + Page + Help)
210*cdf0e10cSrcweir 		if (STANDARD_MARGIN + DETAILS_HEADER_HEIGHT + DETAILS_OPT_PAGE_HEIGHT + DETAILS_MIN_HELP_HEIGHT <= nOutputHeight)
211*cdf0e10cSrcweir 		{	// es reicht zumindest, um beide untereinander (Page optimal, Help minimal) unterzubringen
212*cdf0e10cSrcweir 			nHelpHeight = DETAILS_OPT_HELP_HEIGHT;
213*cdf0e10cSrcweir 			nPageHeight = nOutputHeight - nHelpHeight - DETAILS_HEADER_HEIGHT - STANDARD_MARGIN;
214*cdf0e10cSrcweir 			if (nPageHeight < DETAILS_OPT_PAGE_HEIGHT)
215*cdf0e10cSrcweir 			{	// wie oben : Page optimal, Hilfe soviel wie eben bleibt (das ist groesser/gleich ihrem Minimum)
216*cdf0e10cSrcweir 				long nTransfer = DETAILS_OPT_PAGE_HEIGHT - nPageHeight;
217*cdf0e10cSrcweir 				nPageHeight += nTransfer;
218*cdf0e10cSrcweir 				nHelpHeight -= nTransfer;
219*cdf0e10cSrcweir 			}
220*cdf0e10cSrcweir 			nHelpY = nOutputHeight - nHelpHeight;
221*cdf0e10cSrcweir 			// und ueber die ganze Breite
222*cdf0e10cSrcweir 			nHelpX = 0;					// ohne Margin, da das HelpCtrl einen eigenen hat
223*cdf0e10cSrcweir 			nHelpWidth = nOutputWidth;	// dito
224*cdf0e10cSrcweir 			nPageWidth = nOutputWidth - STANDARD_MARGIN - STANDARD_MARGIN;
225*cdf0e10cSrcweir 		}
226*cdf0e10cSrcweir 		else
227*cdf0e10cSrcweir 		{	// dummerweise reicht es nicht mal, um Page optimal und Help minimal zu zeigen
228*cdf0e10cSrcweir 			nHelpX = nHelpY = nHelpWidth = nHelpHeight = 0;	// -> kein Help-Fenster
229*cdf0e10cSrcweir 			nPageWidth = nOutputWidth - STANDARD_MARGIN - STANDARD_MARGIN;
230*cdf0e10cSrcweir 			nPageHeight = nOutputHeight - STANDARD_MARGIN - DETAILS_HEADER_HEIGHT - STANDARD_MARGIN;
231*cdf0e10cSrcweir 		}
232*cdf0e10cSrcweir 	}
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	m_pHeader->SetPosSizePixel( Point(0, STANDARD_MARGIN), Size(nOutputWidth, 15) );
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir 	getGenPage()->SetPosSizePixel(Point	(	STANDARD_MARGIN,
237*cdf0e10cSrcweir 										STANDARD_MARGIN + DETAILS_HEADER_HEIGHT
238*cdf0e10cSrcweir 									),
239*cdf0e10cSrcweir 							  Size	(	nPageWidth,
240*cdf0e10cSrcweir 										nPageHeight
241*cdf0e10cSrcweir 									)
242*cdf0e10cSrcweir 							 );
243*cdf0e10cSrcweir 	if (nHelpHeight)
244*cdf0e10cSrcweir 	{
245*cdf0e10cSrcweir 		m_pHelpBar->Show();
246*cdf0e10cSrcweir 		m_pHelpBar->SetPosSizePixel(Point	(	nHelpX,
247*cdf0e10cSrcweir 											nHelpY
248*cdf0e10cSrcweir 										),
249*cdf0e10cSrcweir 								  Size	(	nHelpWidth,
250*cdf0e10cSrcweir 											nHelpHeight
251*cdf0e10cSrcweir 										)
252*cdf0e10cSrcweir 								 );
253*cdf0e10cSrcweir 	}
254*cdf0e10cSrcweir 	else
255*cdf0e10cSrcweir 	{
256*cdf0e10cSrcweir 		m_pHelpBar->Hide();
257*cdf0e10cSrcweir 	}
258*cdf0e10cSrcweir 	Invalidate();
259*cdf0e10cSrcweir }
260*cdf0e10cSrcweir // -----------------------------------------------------------------------------
261*cdf0e10cSrcweir IClipboardTest* OTableFieldDescWin::getActiveChild() const
262*cdf0e10cSrcweir {
263*cdf0e10cSrcweir 	IClipboardTest* pTest = NULL;
264*cdf0e10cSrcweir 	switch(m_eChildFocus)
265*cdf0e10cSrcweir 	{
266*cdf0e10cSrcweir 		case DESCRIPTION:
267*cdf0e10cSrcweir 			pTest = getGenPage();
268*cdf0e10cSrcweir 			break;
269*cdf0e10cSrcweir 		default:
270*cdf0e10cSrcweir 			pTest = getHelpBar();
271*cdf0e10cSrcweir 			break;
272*cdf0e10cSrcweir 	}
273*cdf0e10cSrcweir 	return pTest;
274*cdf0e10cSrcweir }
275*cdf0e10cSrcweir // -----------------------------------------------------------------------------
276*cdf0e10cSrcweir sal_Bool OTableFieldDescWin::isCopyAllowed()
277*cdf0e10cSrcweir {
278*cdf0e10cSrcweir 	return getActiveChild() && getActiveChild()->isCopyAllowed();
279*cdf0e10cSrcweir }
280*cdf0e10cSrcweir // -----------------------------------------------------------------------------
281*cdf0e10cSrcweir sal_Bool OTableFieldDescWin::isCutAllowed()
282*cdf0e10cSrcweir {
283*cdf0e10cSrcweir 	return (getGenPage() && getGenPage()->HasChildPathFocus() && getGenPage()->isCutAllowed());
284*cdf0e10cSrcweir }
285*cdf0e10cSrcweir // -----------------------------------------------------------------------------
286*cdf0e10cSrcweir sal_Bool OTableFieldDescWin::isPasteAllowed()
287*cdf0e10cSrcweir {
288*cdf0e10cSrcweir 	return (getGenPage() && getGenPage()->HasChildPathFocus() && getGenPage()->isPasteAllowed());
289*cdf0e10cSrcweir }
290*cdf0e10cSrcweir // -----------------------------------------------------------------------------
291*cdf0e10cSrcweir void OTableFieldDescWin::cut()
292*cdf0e10cSrcweir {
293*cdf0e10cSrcweir 	if ( getGenPage() && getGenPage()->HasChildPathFocus() )
294*cdf0e10cSrcweir 		getGenPage()->cut();
295*cdf0e10cSrcweir }
296*cdf0e10cSrcweir // -----------------------------------------------------------------------------
297*cdf0e10cSrcweir void OTableFieldDescWin::copy()
298*cdf0e10cSrcweir {
299*cdf0e10cSrcweir 	if ( getActiveChild() )
300*cdf0e10cSrcweir 		getActiveChild()->copy();
301*cdf0e10cSrcweir }
302*cdf0e10cSrcweir // -----------------------------------------------------------------------------
303*cdf0e10cSrcweir void OTableFieldDescWin::paste()
304*cdf0e10cSrcweir {
305*cdf0e10cSrcweir 	if ( getGenPage() && getGenPage()->HasChildPathFocus() )
306*cdf0e10cSrcweir 		getGenPage()->paste();
307*cdf0e10cSrcweir }
308*cdf0e10cSrcweir // -----------------------------------------------------------------------------
309*cdf0e10cSrcweir void OTableFieldDescWin::GetFocus()
310*cdf0e10cSrcweir {
311*cdf0e10cSrcweir 	if ( getGenPage() )
312*cdf0e10cSrcweir 		getGenPage()->GetFocus();
313*cdf0e10cSrcweir }
314*cdf0e10cSrcweir // -----------------------------------------------------------------------------
315*cdf0e10cSrcweir void OTableFieldDescWin::LoseFocus()
316*cdf0e10cSrcweir {
317*cdf0e10cSrcweir 	if ( getGenPage() )
318*cdf0e10cSrcweir 		getGenPage()->LoseFocus();
319*cdf0e10cSrcweir }
320*cdf0e10cSrcweir // -----------------------------------------------------------------------------
321*cdf0e10cSrcweir long OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt )
322*cdf0e10cSrcweir {
323*cdf0e10cSrcweir 	sal_Bool bHandled = sal_False;
324*cdf0e10cSrcweir 	switch(rNEvt.GetType())
325*cdf0e10cSrcweir 	{
326*cdf0e10cSrcweir 		case EVENT_GETFOCUS:
327*cdf0e10cSrcweir 			if( getGenPage() && getGenPage()->HasChildPathFocus() )
328*cdf0e10cSrcweir 				m_eChildFocus = DESCRIPTION;
329*cdf0e10cSrcweir 			else
330*cdf0e10cSrcweir 				m_eChildFocus = HELP;
331*cdf0e10cSrcweir 			break;
332*cdf0e10cSrcweir 	}
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir 	return bHandled ? 1L : TabPage::PreNotify(rNEvt);
335*cdf0e10cSrcweir }
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir 
338