Kaydet (Commit) 3bba88bc authored tarafından Gregor Hartmann's avatar Gregor Hartmann

#105538# new Window Type for the TreeListBox

üst 6a312283
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: rcontrol.hxx,v $ * $RCSfile: rcontrol.hxx,v $
* *
* $Revision: 1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mh $ $Date: 2002-11-18 11:12:07 $ * last change: $Author: gh $ $Date: 2002-12-02 10:22:07 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -158,18 +158,19 @@ ...@@ -158,18 +158,19 @@
#define C_PatternBox 60 #define C_PatternBox 60
#define C_ToolBox 61 #define C_ToolBox 61
#define C_ValueSet 62 #define C_ValueSet 62
#define C_Control 63 // Fr das schmutzige Rummachen auf Treelist Boxen ... #define C_Control 63
#define C_TreeListBox 64 // Hurray the TreeListBox finally got its own Window Type
#define C_OkButton 64 #define C_OkButton 65
#define C_CancelButton 65 #define C_CancelButton 66
#define C_ButtonDialog 66 #define C_ButtonDialog 67
// Some new Elements for Mozilla // Some new Elements for Mozilla
#define C_Anchor 67 #define C_Anchor 68
#define C_FormElement 68 #define C_FormElement 69
#define C_DOMText 69 #define C_DOMText 70
#define C_Image 70 #define C_Image 71
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: statemnt.cxx,v $ * $RCSfile: statemnt.cxx,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change: $Author: gh $ $Date: 2002-11-27 12:39:13 $ * last change: $Author: gh $ $Date: 2002-12-02 10:22:07 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#endif #endif
#include <vcl/wintypes.hxx>
#ifndef _DIALOG_HXX //autogen #ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#endif #endif
...@@ -496,6 +497,7 @@ static short ImpGetRType( Window *pWin, ULONG nUId ) ...@@ -496,6 +497,7 @@ static short ImpGetRType( Window *pWin, ULONG nUId )
case WINDOW_OKBUTTON: nRT = C_OkButton; break; case WINDOW_OKBUTTON: nRT = C_OkButton; break;
case WINDOW_CANCELBUTTON: nRT = C_CancelButton; break; case WINDOW_CANCELBUTTON: nRT = C_CancelButton; break;
case WINDOW_BUTTONDIALOG: nRT = C_ButtonDialog; break; case WINDOW_BUTTONDIALOG: nRT = C_ButtonDialog; break;
case WINDOW_TREELISTBOX: nRT = C_TreeListBox; break;
} }
#ifdef DBG_UTIL #ifdef DBG_UTIL
// Die Werte n sind bei den WindowTypen nicht mehr vergeben, werden aber in der AutoID noch verwendet // Die Werte n sind bei den WindowTypen nicht mehr vergeben, werden aber in der AutoID noch verwendet
...@@ -4676,6 +4678,7 @@ BOOL StatementControl::Execute() ...@@ -4676,6 +4678,7 @@ BOOL StatementControl::Execute()
else else
{ {
ListBox *pLB = ((ListBox*)pControl); ListBox *pLB = ((ListBox*)pControl);
pLB = static_cast<ListBox*>(pControl);
if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,pLB->GetEntryCount()) ) if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,pLB->GetEntryCount()) )
{ {
if ( bUnselectBeforeSelect ) if ( bUnselectBeforeSelect )
...@@ -5139,19 +5142,9 @@ BOOL StatementControl::Execute() ...@@ -5139,19 +5142,9 @@ BOOL StatementControl::Execute()
break; break;
} }
break; break;
case C_Control: case C_TreeListBox:
switch( nMethodId ) switch( nMethodId )
{ {
case M_AnimateMouse :
AnimateMouse( pControl, MitteOben);
break;
default:
switch( nControlType )
{
case CONST_CTTreeListBox:
switch( nMethodId )
{
...@@ -5193,153 +5186,149 @@ USHORT nValidTextItemCount = 0;\ ...@@ -5193,153 +5186,149 @@ USHORT nValidTextItemCount = 0;\
}\ }\
} }
case M_GetText : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) case M_GetText :
// aber WP hat gesagt! {
{ SvTreeListBox *pTree = (SvTreeListBox*)pControl;
SvTreeListBox *pTree = (SvTreeListBox*)pControl; SvLBoxEntry *pThisEntry = pTree->GetCurEntry();
SvLBoxEntry *pThisEntry = pTree->GetCurEntry(); if ( ! (nParams & PARAM_USHORT_1) )
if ( ! (nParams & PARAM_USHORT_1) ) nNr1 = 1;
nNr1 = 1; if ( pThisEntry )
if ( pThisEntry ) {
{ GetFirstValidTextItem( pThisEntry, nNr1 );
GetFirstValidTextItem( pThisEntry, nNr1 ); if ( ValueOK( nUId, CUniString("GetText"), nNr1, nValidTextItemCount ) )
if ( ValueOK( nUId, CUniString("GetText"), nNr1, nValidTextItemCount ) ) pRet->GenReturn ( RET_Value, nUId, pItem->GetText() );
pRet->GenReturn ( RET_Value, nUId, pItem->GetText() ); }
} else
else ReportError( nUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) );
ReportError( nUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) ); }
} break;
break; case M_GetSelCount :
case M_GetSelCount : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) pRet->GenReturn ( RET_Value, nUId, ULONG(((SvLBox*)pControl)->GetSelectionCount()));
// aber WP hat gesagt! break;
pRet->GenReturn ( RET_Value, nUId, ULONG(((SvLBox*)pControl)->GetSelectionCount())); case M_GetSelIndex :
break; if ( ! (nParams & PARAM_USHORT_1) )
case M_GetSelIndex : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) nNr1 = 1;
// aber WP hat gesagt! if ( ValueOK(nUId, CUniString("GetSelIndex"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) )
if ( ! (nParams & PARAM_USHORT_1) ) {
nNr1 = 1; nNr1--;
if ( ValueOK(nUId, CUniString("GetSelIndex"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) COUNT_LBOX( FirstSelected, NextSelected, nNr1);
{ pRet->GenReturn ( RET_Value, nUId, ULONG( ((SvTreeListBox*)pControl)->GetVisiblePos( pThisEntry )) +1 );
nNr1--; }
COUNT_LBOX( FirstSelected, NextSelected, nNr1); break;
pRet->GenReturn ( RET_Value, nUId, ULONG( ((SvTreeListBox*)pControl)->GetVisiblePos( pThisEntry )) +1 ); case M_GetSelText :
} if ( ! (nParams & PARAM_USHORT_1) )
break; nNr1 = 1;
case M_GetSelText : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) if ( ! (nParams & PARAM_USHORT_2) )
// aber WP hat gesagt! nNr2 = 1;
if ( ! (nParams & PARAM_USHORT_1) ) if ( ValueOK(nUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) )
nNr1 = 1; {
if ( ! (nParams & PARAM_USHORT_2) ) nNr1--;
nNr2 = 1; COUNT_LBOX( FirstSelected, NextSelected, nNr1);
if ( ValueOK(nUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) GetFirstValidTextItem( pThisEntry, nNr2 );
{ if ( ValueOK( nUId, CUniString("GetSelText"), nNr2, nValidTextItemCount ) )
nNr1--; pRet->GenReturn ( RET_Value, nUId, pItem->GetText() );
COUNT_LBOX( FirstSelected, NextSelected, nNr1); }
GetFirstValidTextItem( pThisEntry, nNr2 ); break;
if ( ValueOK( nUId, CUniString("GetSelText"), nNr2, nValidTextItemCount ) ) case M_GetItemCount :
pRet->GenReturn ( RET_Value, nUId, pItem->GetText() ); pRet->GenReturn ( RET_Value, nUId, ULONG(((SvLBox*)pControl)->GetVisibleCount()) );
} break;
break; case M_GetItemText :
case M_GetItemCount : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
// aber WP hat gesagt! {
pRet->GenReturn ( RET_Value, nUId, ULONG(((SvLBox*)pControl)->GetVisibleCount()) ); SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 );
break; if ( ! (nParams & PARAM_USHORT_2) )
case M_GetItemText : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) nNr2 = 1;
// aber WP hat gesagt! GetFirstValidTextItem( pEntry, nNr2 );
if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) ) if ( ValueOK( nUId, CUniString("GetItemText"), nNr2, nValidTextItemCount ) )
{ pRet->GenReturn ( RET_Value, nUId, pItem->GetText() );
SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 ); }
if ( ! (nParams & PARAM_USHORT_2) ) break;
nNr2 = 1; case M_Select :
GetFirstValidTextItem( pEntry, nNr2 ); if ( ! (nParams & PARAM_BOOL_1) )
if ( ValueOK( nUId, CUniString("GetItemText"), nNr2, nValidTextItemCount ) ) bBool1 = TRUE;
pRet->GenReturn ( RET_Value, nUId, pItem->GetText() ); if( nParams & PARAM_STR_1 )
} {
break; /* ListBox *pLB = ((ListBox*)pControl);
case M_Select : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) if ( pLB->GetEntryPos( aString1 ) == LISTBOX_ENTRY_NOTFOUND )
// aber WP hat gesagt! ReportError( nUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) );
if ( ! (nParams & PARAM_BOOL_1) ) else
bBool1 = TRUE; {
if( nParams & PARAM_STR_1 ) pLB->SelectEntry( aString1, bBool1 );
{ if ( pLB->IsEntrySelected( aString1 ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL
/* ListBox *pLB = ((ListBox*)pControl); ReportError( nUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), aString1 ) );
if ( pLB->GetEntryPos( aString1 ) == LISTBOX_ENTRY_NOTFOUND ) }
ReportError( nUId, GEN_RES_STR2( S_ENTRY_NOT_FOUND, MethodString( nMethodId ), aString1 ) ); */ ReportError( nUId, GEN_RES_STR1( S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED, MethodString( nMethodId ) ) );
else }
{ else
pLB->SelectEntry( aString1, bBool1 ); {
if ( pLB->IsEntrySelected( aString1 ) ? !bBool1 : bBool1 ) // XOR rein mit BOOL if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) )
ReportError( nUId, GEN_RES_STR2( S_METHOD_FAILED, MethodString( nMethodId ), aString1 ) ); {
} SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 );
*/ ReportError( nUId, GEN_RES_STR1( S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED, MethodString( nMethodId ) ) ); ((SvTreeListBox*)pControl)->Select ( pEntry, bBool1 );
} }
else }
{ break;
if ( ValueOK(nUId, MethodString( nMethodId ),nNr1,((SvLBox*)pControl)->GetVisibleCount()) ) case M_IsChecked :
{ case M_IsTristate :
SvLBoxEntry *pEntry = (SvLBoxEntry*)((SvTreeListBox*)pControl)->GetEntryAtVisPos( nNr1-1 ); case M_GetState :
((SvTreeListBox*)pControl)->Select ( pEntry, bBool1 ); case M_Check :
} case M_UnCheck :
} case M_TriState :
break; {
case M_IsChecked : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) SvTreeListBox *pTree = (SvTreeListBox*)pControl;
case M_IsTristate : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) SvLBoxEntry *pThisEntry = pTree->GetCurEntry();
case M_GetState : if ( !pThisEntry )
case M_Check : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) ReportError( nUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) );
case M_UnCheck : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) else
case M_TriState : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) {
// aber WP hat gesagt! SvLBoxButton* pItem = (SvLBoxButton*)(pThisEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
{ if(!pItem)
SvTreeListBox *pTree = (SvTreeListBox*)pControl; ReportError( nUId, GEN_RES_STR1( S_NO_LIST_BOX_BUTTON, MethodString( nMethodId ) ) );
SvLBoxEntry *pThisEntry = pTree->GetCurEntry(); else
if ( !pThisEntry ) switch( nMethodId )
ReportError( nUId, GEN_RES_STR2c2( S_NO_SELECTED_ENTRY, MethodString( nMethodId ), "TreeListBox" ) ); {
else case M_IsChecked :
{ pRet->GenReturn ( RET_Value, nUId, BOOL( pItem->IsStateChecked() ) );
SvLBoxButton* pItem = (SvLBoxButton*)(pThisEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON)); break;
if(!pItem) case M_IsTristate :
ReportError( nUId, GEN_RES_STR1( S_NO_LIST_BOX_BUTTON, MethodString( nMethodId ) ) ); pRet->GenReturn ( RET_Value, nUId, BOOL( pItem->IsStateTristate() ) );
else break;
switch( nMethodId ) case M_GetState :
{ pRet->GenReturn ( RET_Value, nUId, ULONG( pItem->GetButtonFlags() & ~SV_STATE_MASK ));
case M_IsChecked : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) break;
// aber WP hat gesagt! case M_Check :
pRet->GenReturn ( RET_Value, nUId, BOOL( pItem->IsStateChecked() ) ); pItem->SetStateChecked();
break; pTree->InvalidateEntry( pThisEntry );
case M_IsTristate : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) break;
// aber WP hat gesagt! case M_UnCheck :
pRet->GenReturn ( RET_Value, nUId, BOOL( pItem->IsStateTristate() ) ); pItem->SetStateUnchecked();
break; pTree->InvalidateEntry( pThisEntry );
case M_GetState : break;
pRet->GenReturn ( RET_Value, nUId, ULONG( pItem->GetButtonFlags() & ~SV_STATE_MASK )); case M_TriState :
break; pItem->SetStateTristate();
case M_Check : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) pTree->InvalidateEntry( pThisEntry );
// aber WP hat gesagt! break;
pItem->SetStateChecked(); default:
pTree->InvalidateEntry( pThisEntry ); ReportError( nUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) );
break; break;
case M_UnCheck : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) }
// aber WP hat gesagt! }
pItem->SetStateUnchecked(); }
pTree->InvalidateEntry( pThisEntry ); break;
break; default:
case M_TriState : // TreeListBox wird angenommen! (Das kann ja nur schief gehen) ReportError( nUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TreeListBox" ) );
// aber WP hat gesagt! break;
pItem->SetStateTristate(); }
pTree->InvalidateEntry( pThisEntry ); break;
break; case C_Control:
default: switch( nMethodId )
ReportError( nUId, GEN_RES_STR1( S_INTERNAL_ERROR, MethodString( nMethodId ) ) ); {
break; case M_AnimateMouse :
} AnimateMouse( pControl, MitteOben);
} break;
} default:
break; switch( nControlType )
default: {
ReportError( nUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TreeListBox" ) );
break;
}
break;
case CONST_CTBrowseBox: case CONST_CTBrowseBox:
switch( nMethodId ) switch( nMethodId )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment