summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-12 12:49:58 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-12 13:27:12 +0000
commit166d8257979aac6775319a9e1f305bc94df97e29 (patch)
tree780a7ba43ff9b8ba1f449238d23d2e62b9c8777a
parent0c870ab35f0648ac5e87adc84ad4c711c4774330 (diff)
Resolves: fdo#57469 allow tab to traverse into custom widgets
The magic WB_TABSTOP bit is the one that allows a widget to be accepted as a candidate for getting focus when pressing tab Change-Id: I7d964bae6b84184ccbc4652d66cf3d2637566405
-rw-r--r--basctl/source/basicide/bastype2.cxx2
-rw-r--r--cui/source/customize/selector.cxx4
-rw-r--r--cui/source/dialogs/hyphen.cxx2
-rw-r--r--cui/source/dialogs/scriptdlg.cxx2
-rw-r--r--cui/source/dialogs/thesdlg.cxx4
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx8
-rw-r--r--svx/source/dialog/charmap.cxx2
-rw-r--r--svx/source/dialog/fontlb.cxx2
-rw-r--r--svx/source/dialog/langbox.cxx2
-rw-r--r--sw/source/ui/cctrl/actctrl.cxx8
-rw-r--r--sw/source/ui/misc/numberingtypelistbox.cxx2
-rw-r--r--vcl/inc/vcl/layout.hxx13
-rw-r--r--vcl/source/control/edit.cxx14
-rw-r--r--vcl/source/window/dialog.cxx10
-rw-r--r--vcl/source/window/dlgctrl.cxx2
16 files changed, 57 insertions, 22 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 7ea6699b8719..4d2e7e93e053 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -194,7 +194,7 @@ TreeListBox::TreeListBox (Window* pParent, ResId const& rRes)
}
TreeListBox::TreeListBox (Window* pParent)
- : SvTreeListBox(pParent)
+ : SvTreeListBox(pParent, WB_TABSTOP)
, m_aNotifier( *this )
{
Init();
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 8d4af3ef78f4..dfa8af78f897 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -72,7 +72,7 @@ using namespace ::com::sun::star::container;
* SvxConfigGroupListBox are copied from sfx2/source/dialog/cfg.cxx
*/
SvxConfigFunctionListBox::SvxConfigFunctionListBox(Window* pParent)
- : SvTreeListBox(pParent, WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT)
+ : SvTreeListBox(pParent, WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT | WB_TABSTOP)
, pCurEntry(0)
, m_pDraggingEntry(0)
{
@@ -187,7 +187,7 @@ SvxConfigFunctionListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
SvxConfigGroupListBox::SvxConfigGroupListBox(Window* pParent)
: SvTreeListBox(pParent,
- WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT)
+ WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT | WB_TABSTOP)
, m_bShowSlots(false)
, m_hdImage(CUI_RES(RID_CUIIMG_HARDDISK))
, m_libImage(CUI_RES(RID_CUIIMG_LIB))
diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index de16810aeff1..15799416fbe6 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -36,7 +36,7 @@
#define CUR_HYPH_POS_CHAR '-'
HyphenEdit::HyphenEdit(Window* pParent)
- : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK)
+ : Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK|WB_TABSTOP)
{
}
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index f149a59879ef..c3ee4883e789 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -85,7 +85,7 @@ SFTreeListBox::SFTreeListBox(Window* pParent)
SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL |
WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HIDESELECTION |
- WB_HASLINES | WB_HASLINESATROOT );
+ WB_HASLINES | WB_HASLINESATROOT | WB_TABSTOP );
SetNodeDefaultImages();
nMode = 0xFF; // everything
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 54a80f1de6fe..24f97b0c5de1 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -58,7 +58,7 @@ using ::rtl::OUString;
// class LookUpComboBox --------------------------------------------------
LookUpComboBox::LookUpComboBox(Window *pParent)
- : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK)
+ : ComboBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP)
{
EnableAutoSize(true);
@@ -97,7 +97,7 @@ IMPL_LINK( LookUpComboBox, ModifyTimer_Hdl, Timer *, EMPTYARG /*pTimer*/ )
// class ReplaceEdit --------------------------------------------------
ReplaceEdit::ReplaceEdit(Window *pParent)
- : Edit(pParent)
+ : Edit(pParent, WB_BORDER | WB_TABSTOP)
{
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index f55ef953dfcf..b6c9613f79ca 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -454,7 +454,7 @@ SvTreeListBox::SvTreeListBox(Window* pParent, const ResId& rResId) :
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvTreeListBox(Window *pParent, VclBuilder::stringmap &)
{
- return new SvTreeListBox(pParent);
+ return new SvTreeListBox(pParent, WB_TABSTOP);
}
void SvTreeListBox::Clear()
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index dd739d40f509..85eb235b1b44 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -133,7 +133,7 @@ namespace
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorListBox(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = extractDropdown(rMap);
- WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
ColorListBox *pListBox = new ColorListBox(pParent, nWinBits);
@@ -1042,7 +1042,7 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontNameBox(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = extractDropdown(rMap);
- WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
FontNameBox *pListBox = new FontNameBox(pParent, nWinBits);
@@ -1431,7 +1431,7 @@ FontStyleBox::FontStyleBox( Window* pParent, WinBits nBits ) :
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontStyleBox(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = extractDropdown(rMap);
- WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
FontStyleBox *pListBox = new FontStyleBox(pParent, nWinBits);
@@ -1651,7 +1651,7 @@ FontSizeBox::FontSizeBox( Window* pParent, const ResId& rResId ) :
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontSizeBox(Window *pParent, VclBuilder::stringmap &rMap)
{
bool bDropdown = extractDropdown(rMap);
- WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+ WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP;
if (bDropdown)
nWinBits |= WB_DROPDOWN;
FontSizeBox* pListBox = new FontSizeBox(pParent, nWinBits);
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 817f2ddf02e4..42b6417703bf 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -66,7 +66,7 @@ SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId)
}
SvxShowCharSet::SvxShowCharSet(Window* pParent)
- : Control(pParent)
+ : Control(pParent, WB_TABSTOP)
, m_pAccessible(NULL)
, aVscrollSB( this, WB_VERT)
{
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index 1e6ceb8f8490..131ca43dc0d3 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -99,7 +99,7 @@ SvxFontListBox::SvxFontListBox(Window* pParent, WinBits nStyle)
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxFontListBox(Window *pParent, VclBuilder::stringmap &)
{
- return new SvxFontListBox(pParent, 0);
+ return new SvxFontListBox(pParent, WB_TABSTOP);
}
void SvxFontListBox::InsertFontEntry( const String& rString, const Font& rFont, const Color* pColor )
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 495ebd056ddd..c36517d553f3 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -139,7 +139,7 @@ SvxLanguageBox::SvxLanguageBox( Window* pParent, WinBits nBits, sal_Bool bCheck
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxLanguageBox(Window *pParent, VclBuilder::stringmap &)
{
- SvxLanguageBox *pListBox = new SvxLanguageBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
+ SvxLanguageBox *pListBox = new SvxLanguageBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
pListBox->EnableAutoSize(true);
return pListBox;
}
diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx
index 010f1a9e8e2c..d930a46a6a55 100644
--- a/sw/source/ui/cctrl/actctrl.cxx
+++ b/sw/source/ui/cctrl/actctrl.cxx
@@ -51,14 +51,14 @@ long NumEditAction::Notify( NotifyEvent& rNEvt )
}
NoSpaceEdit::NoSpaceEdit( Window* pParent, const ResId& rResId)
- : Edit(pParent, rResId),
- sForbiddenChars(rtl::OUString(" "))
+ : Edit(pParent, rResId)
+ , sForbiddenChars(rtl::OUString(" "))
{
}
NoSpaceEdit::NoSpaceEdit(Window* pParent)
- : Edit(pParent),
- sForbiddenChars(rtl::OUString(" "))
+ : Edit(pParent, WB_BORDER|WB_TABSTOP)
+ , sForbiddenChars(rtl::OUString(" "))
{
}
diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx
index 83660ccc76e0..13445525ea8f 100644
--- a/sw/source/ui/misc/numberingtypelistbox.cxx
+++ b/sw/source/ui/misc/numberingtypelistbox.cxx
@@ -70,7 +70,7 @@ bool SwNumberingTypeListBox::set_property(const rtl::OString &rKey, const rtl::O
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwNumberingTypeListBox(Window *pParent, VclBuilder::stringmap &)
{
- SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK);
+ SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP);
pListBox->EnableAutoSize(true);
return pListBox;
}
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index b09b112348f0..d9c5e6352a7f 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -547,12 +547,25 @@ bool isVisibleInLayout(const Window *pWindow);
//return true if this window and its stack of containers are all enabled
bool isEnabledInLayout(const Window *pWindow);
+//Get first window of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_FIRSTCHILD);
+//in a flat hierarchy where dialogs only have one layer
+//of children
+Window* firstLogicalChildOfParent(Window *pTopLevel);
+
//Get next window after pChild of a pTopLevel window as
//if any intermediate layout widgets didn't exist
//i.e. acts like pChild = pChild->GetWindow(WINDOW_NEXT);
//in a flat hierarchy where dialogs only have one layer
//of children
Window* nextLogicalChildOfParent(Window *pTopLevel, Window *pChild);
+
+//Get previous window before pChild of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+//i.e. acts like pChild = pChild->GetWindow(WINDOW_PREV);
+//in a flat hierarchy where dialogs only have one layer
+//of children
Window* prevLogicalChildOfParent(Window *pTopLevel, Window *pChild);
inline bool isContainerWindow(const Window &rWindow)
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 7d30f65699a5..0ba51194ce88 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -225,7 +225,19 @@ bool Edit::set_property(const rtl::OString &rKey, const rtl::OString &rValue)
SetMaxTextLen(nTextLen == 0 ? EDIT_NOLIMIT : nTextLen);
}
else if (rKey == "editable")
- SetReadOnly(!toBool(rValue));
+ {
+ bool bReadOnly = !toBool(rValue);
+ SetReadOnly(bReadOnly);
+ //disable tab to traverse into readonly editables
+ WinBits nBits = GetStyle();
+ nBits &= ~(WB_TABSTOP|WB_NOTABSTOP);
+ if (!bReadOnly)
+ nBits |= WB_TABSTOP;
+ else
+ nBits |= WB_NOTABSTOP;
+ fprintf(stderr, "tabstop is %ld\n", nBits & WB_TABSTOP);
+ SetStyle(nBits);
+ }
else if (rKey == "visibility")
{
WinBits nBits = GetStyle();
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 24da8ef7c23b..bea6412cb6e5 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -171,6 +171,16 @@ Window * prevLogicalChildOfParent(Window *pTopLevel, Window *pChild)
return pChild;
}
+//Get first window of a pTopLevel window as
+//if any intermediate layout widgets didn't exist
+Window * firstLogicalChildOfParent(Window *pTopLevel)
+{
+ Window *pChild = pTopLevel->GetWindow(WINDOW_FIRSTCHILD);
+ if (pChild && isContainerWindow(*pChild))
+ pChild = nextLogicalChildOfParent(pTopLevel, pChild);
+ return pChild;
+}
+
// -----------------------------------------------------------------------
void ImplWindowAutoMnemonic( Window* pWindow )
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 0ff589bc3407..6c481da574a6 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -78,7 +78,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16&
Window* pTabPage = NULL;
Window* pFoundWindow = NULL;
- Window* pWindow = pParent->GetWindow( WINDOW_FIRSTCHILD );
+ Window* pWindow = firstLogicalChildOfParent(pParent);
Window* pNextWindow = pWindow;
while ( pWindow )
{