Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
744d6e22
Kaydet (Commit)
744d6e22
authored
Eyl 03, 2012
tarafından
Noel Power
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
crummy but psuedo usable scrollable dialog
Change-Id: I93c49f2e2e313f27b660f3998cb5e8e2cd520ada
üst
e7d85cc0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
2 deletions
+175
-2
Library_tk.mk
toolkit/Library_tk.mk
+2
-0
scrollabledialog.hxx
toolkit/inc/toolkit/awt/scrollabledialog.hxx
+60
-0
scrollabledialog.cxx
toolkit/source/awt/scrollabledialog.cxx
+102
-0
vclxtoolkit.cxx
toolkit/source/awt/vclxtoolkit.cxx
+11
-2
No files found.
toolkit/Library_tk.mk
Dosyayı görüntüle @
744d6e22
...
...
@@ -52,12 +52,14 @@ $(eval $(call gb_Library_use_libraries,tk,\
tl \
utl \
vcl \
svt \
$(gb_STDLIBS) \
))
$(eval $(call gb_Library_add_exception_objects,tk,\
toolkit/source/awt/asynccallback \
toolkit/source/awt/stylesettings \
toolkit/source/awt/scrollabledialog \
toolkit/source/awt/vclxaccessiblecomponent \
toolkit/source/awt/vclxbitmap \
toolkit/source/awt/vclxcontainer \
...
...
toolkit/inc/toolkit/awt/scrollabledialog.hxx
0 → 100644
Dosyayı görüntüle @
744d6e22
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#ifndef TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
#define TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
#include <vcl/dialog.hxx>
#include <vcl/scrbar.hxx>
//........................................................................
namespace
toolkit
{
class
ScrollableDialog
:
public
Dialog
{
Window
maContents
;
ScrollBar
maHScrollBar
;
ScrollBar
maVScrollBar
;
bool
mbHasHoriBar
;
bool
mbHasVertBar
;
Point
mnScrollPos
;
public
:
ScrollableDialog
(
Window
*
pParent
,
WinBits
nStyle
=
WB_STDDIALOG
);
virtual
~
ScrollableDialog
();
Window
*
getContentWindow
();
DECL_LINK
(
ScrollBarHdl
,
ScrollBar
*
);
DECL_LINK
(
ContainerScrolled
,
void
*
);
// Window
virtual
void
Resize
();
};
//........................................................................
}
// namespacetoolkit
//........................................................................
#endif // TOOLKIT_AWT_SCROLLABLEDIALOG_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
toolkit/source/awt/scrollabledialog.cxx
0 → 100644
Dosyayı görüntüle @
744d6e22
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <toolkit/awt/scrollabledialog.hxx>
namespace
toolkit
{
ScrollableDialog
::
ScrollableDialog
(
Window
*
pParent
,
WinBits
nStyle
)
:
Dialog
(
pParent
,
nStyle
),
maContents
(
this
,
nStyle
),
maHScrollBar
(
this
,
WB_HSCROLL
|
WB_DRAG
),
maVScrollBar
(
this
,
WB_VSCROLL
|
WB_DRAG
),
mbHasHoriBar
(
true
),
mbHasVertBar
(
true
)
{
Link
aLink
(
LINK
(
this
,
ScrollableDialog
,
ScrollBarHdl
)
);
maVScrollBar
.
SetScrollHdl
(
aLink
);
maHScrollBar
.
SetScrollHdl
(
aLink
);
maContents
.
Show
();
maVScrollBar
.
Show
();
maHScrollBar
.
Show
();
}
ScrollableDialog
::~
ScrollableDialog
()
{
}
Window
*
ScrollableDialog
::
getContentWindow
()
{
return
&
maContents
;
}
IMPL_LINK
(
ScrollableDialog
,
ScrollBarHdl
,
ScrollBar
*
,
pSB
)
{
sal_uInt16
nPos
=
(
sal_uInt16
)
pSB
->
GetThumbPos
();
Rectangle
aScrollableArea
(
0
,
0
,
maContents
.
GetSizePixel
().
Width
(),
maContents
.
GetSizePixel
().
Height
()
);
if
(
pSB
==
&
maVScrollBar
)
{
printf
(
"vertical scroll %d
\n
"
,
nPos
);
printf
(
"vertical scroll %d
\n
"
,
nPos
);
long
nScroll
=
mnScrollPos
.
Y
()
-
nPos
;
maContents
.
Scroll
(
0
,
nScroll
,
aScrollableArea
);
mnScrollPos
.
Y
()
=
nPos
;
}
else
if
(
pSB
==
&
maHScrollBar
)
{
printf
(
"horizontal scroll %d
\n
"
,
nPos
);
long
nScroll
=
mnScrollPos
.
X
()
-
nPos
;
maContents
.
Scroll
(
nScroll
,
0
,
aScrollableArea
);
mnScrollPos
.
X
()
=
nPos
;
}
return
1
;
}
void
ScrollableDialog
::
Resize
()
{
printf
(
"ScrollableDialog::Resize() - size is width %d height %d
\n
"
,
GetSizePixel
().
Width
(),
GetSizePixel
().
Height
()
);
maContents
.
SetSizePixel
(
GetSizePixel
()
);
// find the output area for the window
long
nMaxX
=
GetSizePixel
().
Width
();
long
nMaxY
=
GetSizePixel
().
Height
();
for
(
int
index
=
0
,
count
=
maContents
.
GetChildCount
();
index
<
count
;
++
index
)
{
Window
*
pChild
=
maContents
.
GetChild
(
index
);
if
(
pChild
)
{
Point
aPos
=
pChild
->
GetPosPixel
();
Size
aSize
=
pChild
->
GetSizePixel
();
long
nX
=
aPos
.
X
()
+
aSize
.
Width
();
long
nY
=
aPos
.
Y
()
+
aSize
.
Height
();
if
(
nX
>
nMaxX
)
nMaxX
=
nX
;
if
(
nY
>
nMaxY
)
nMaxY
=
nY
;
}
}
Size
aOutSz
=
GetOutputSizePixel
();
long
nScrWidth
=
GetSettings
().
GetStyleSettings
().
GetScrollBarSize
();
// assume for the moment that we have both hori & vert scroll bars
Size
aContentsSize
(
aOutSz
);
if
(
mbHasVertBar
)
{
aContentsSize
.
Width
()
-=
nScrWidth
;
nMaxX
+=
nScrWidth
;
}
if
(
mbHasHoriBar
)
{
aContentsSize
.
Height
()
-=
nScrWidth
;
nMaxY
+=
nScrWidth
;
}
maContents
.
SetSizePixel
(
aContentsSize
);
Point
aVPos
(
aOutSz
.
Width
()
-
nScrWidth
,
0
);
Point
aHPos
(
0
,
aOutSz
.
Height
()
-
nScrWidth
);
maVScrollBar
.
SetPosSizePixel
(
aVPos
,
Size
(
nScrWidth
,
aContentsSize
.
Height
()
)
);
maHScrollBar
.
SetPosSizePixel
(
aHPos
,
Size
(
aContentsSize
.
Width
(),
nScrWidth
)
);
maHScrollBar
.
SetRangeMax
(
nMaxX
);
maHScrollBar
.
SetVisibleSize
(
GetSizePixel
().
Width
()
);
maHScrollBar
.
SetPageSize
(
GetSizePixel
().
Width
()
);
maVScrollBar
.
SetRangeMax
(
nMaxY
);
maVScrollBar
.
SetVisibleSize
(
GetSizePixel
().
Height
()
);
maVScrollBar
.
SetPageSize
(
GetSizePixel
().
Height
()
);
}
}
// toolkit
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
toolkit/source/awt/vclxtoolkit.cxx
Dosyayı görüntüle @
744d6e22
...
...
@@ -129,9 +129,10 @@ using org::libreoffice::touch::ByteBufferWrapper;
#include <vcl/wrkwin.hxx>
#include <vcl/throbber.hxx>
#include "toolkit/awt/vclxspinbutton.hxx"
#include "toolkit/awt/scrollabledialog.hxx"
#include <tools/debug.hxx>
#include <comphelper/processfactory.hxx>
#include <toolkit/awt/scrollabledialog.hxx>
namespace
css
=
::
com
::
sun
::
star
;
...
...
@@ -786,7 +787,7 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
// Modal/Modeless nur durch Show/Execute
if
(
(
pParent
==
NULL
)
&&
(
rDescriptor
.
ParentIndex
==
-
1
)
)
pParent
=
DIALOG_NO_PARENT
;
pNewWindow
=
new
Dialog
(
pParent
,
nWinBits
);
pNewWindow
=
new
toolkit
::
ScrollableDialog
(
pParent
,
nWinBits
|
WB_AUTOHSCROLL
|
WB_AUTOVSCROLL
);
// #i70217# Don't always create a new component object. It's possible that VCL has called
// GetComponentInterface( sal_True ) in the Dialog ctor itself (see Window::IsTopWindow() )
// which creates a component object.
...
...
@@ -1061,6 +1062,14 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
if
(
pParentComponent
)
pParent
=
pParentComponent
->
GetWindow
();
}
// #FIXME inglorious HACK we possibly need to interface at XContainerWindowPeer ?
// to allow access to the 'real' parent that we pass to children
toolkit
::
ScrollableDialog
*
pSrcDialog
=
dynamic_cast
<
toolkit
::
ScrollableDialog
*
>
(
pParent
);
if
(
pSrcDialog
)
{
printf
(
"found a parent that is a scrollable dialog
\n
"
);
pParent
=
pSrcDialog
->
getContentWindow
();
}
WinBits
nWinBits
=
ImplGetWinBits
(
rDescriptor
.
WindowAttributes
,
ImplGetComponentType
(
rDescriptor
.
WindowServiceName
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment