summaryrefslogtreecommitdiff
path: root/automation/source/miniapp
diff options
context:
space:
mode:
authorMartin Hollmichel <mh@openoffice.org>2002-11-18 10:19:28 +0000
committerMartin Hollmichel <mh@openoffice.org>2002-11-18 10:19:28 +0000
commit02f4ad619774297658085bb84fcb5d009dbfe715 (patch)
treea188136f7971b3f83e94978990d1cac5d14193d1 /automation/source/miniapp
parenta561af855646784133dc16a8130c434be2b5b3e7 (diff)
add: testtool, #104916#
Diffstat (limited to 'automation/source/miniapp')
-rw-r--r--automation/source/miniapp/editwin.cxx159
-rw-r--r--automation/source/miniapp/editwin.hxx109
-rw-r--r--automation/source/miniapp/hid.lst27
-rw-r--r--automation/source/miniapp/makefile.mk92
-rw-r--r--automation/source/miniapp/servres.cxx91
-rw-r--r--automation/source/miniapp/servres.hrc74
-rw-r--r--automation/source/miniapp/servres.hxx117
-rw-r--r--automation/source/miniapp/servres.src267
-rw-r--r--automation/source/miniapp/servuid.hxx71
-rw-r--r--automation/source/miniapp/test.bas135
-rw-r--r--automation/source/miniapp/test.sid5
-rw-r--r--automation/source/miniapp/test.win13
-rw-r--r--automation/source/miniapp/testapp.cxx313
-rw-r--r--automation/source/miniapp/testapp.hxx160
14 files changed, 1633 insertions, 0 deletions
diff --git a/automation/source/miniapp/editwin.cxx b/automation/source/miniapp/editwin.cxx
new file mode 100644
index 000000000000..50a333a20a92
--- /dev/null
+++ b/automation/source/miniapp/editwin.cxx
@@ -0,0 +1,159 @@
+/*************************************************************************
+ *
+ * $RCSfile: editwin.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:17:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "editwin.hxx"
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+
+
+BOOL GHEditWindow::Close()
+{
+ if (aInhalt.IsModified())
+ {
+ }
+ delete(this);
+ return TRUE;
+}
+
+void GHEditWindow::Resize()
+{
+ aInhalt.SetPosSizePixel(Point(1,1),GetOutputSizePixel());
+}
+
+GHEditWindow::GHEditWindow(Window * pParent, String aName, WinBits iWstyle)
+: FloatingWindow(pParent)
+, aInhalt(this,iWstyle)
+{
+ Show();
+ Resize();
+ aInhalt.Show();
+ SetText(aName);
+}
+
+void GHEditWindow::Clear()
+{
+ aInhalt.SetText(String());
+}
+
+void GHEditWindow::AddText( String aNew, BOOL bMoveToEnd)
+{
+ String aOld = aInhalt.GetText();
+
+ aOld += aNew;
+ aOld.ConvertLineEnd();
+ aInhalt.SetText(aOld);
+ if (bMoveToEnd)
+ aInhalt.SetSelection(Selection(SELECTION_MAX,SELECTION_MAX));
+}
+
+
+EditFileWindow::EditFileWindow(Window * pParent, String aName, WinBits iWstyle)
+: GHEditWindow(pParent, aName, iWstyle)
+, aFileName(aName)
+{
+ LoadFile();
+}
+
+void EditFileWindow::LoadFile()
+{
+
+ SvFileStream Stream;
+ String All,Line;
+
+ Stream.Open(aFileName, STREAM_STD_READ);
+
+ if (!Stream.IsOpen())
+ {
+ AddText(CUniString("could not open ").Append(aFileName).AppendAscii("\n"));
+ aFileName.Erase();
+ return;
+ }
+
+ while (!Stream.IsEof())
+ {
+
+ Stream.ReadByteStringLine( Line, RTL_TEXTENCODING_UTF8 );
+
+ All += Line;
+ All += '\n';
+
+ }
+
+ All.ConvertLineEnd();
+
+ AddText(All,FALSE);
+
+}
+
+BOOL EditFileWindow::Close()
+{
+
+ if (aInhalt.IsModified() && QueryBox(this,WB_DEF_YES | WB_YES_NO_CANCEL, String(aFileName).AppendAscii("\nwurde verndert.\n\nDatei Speichern?")).Execute())
+ {
+
+ }
+ return GHEditWindow::Close();
+}
+
diff --git a/automation/source/miniapp/editwin.hxx b/automation/source/miniapp/editwin.hxx
new file mode 100644
index 000000000000..d9a9cdbc2709
--- /dev/null
+++ b/automation/source/miniapp/editwin.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: editwin.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:17:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _editwin
+#define _editwin
+
+#ifndef _BASIC_TTRESHLP_HXX
+#include <basic/ttstrhlp.hxx>
+#endif
+
+#ifndef _SV_FLOATWIN_HXX
+#include <vcl/floatwin.hxx>
+#endif
+#ifndef _SVEDIT_HXX
+#include <svtools/svmedit.hxx>
+#endif
+
+class GHEditWindow : public FloatingWindow
+{
+
+protected:
+
+ MultiLineEdit aInhalt;
+
+ virtual BOOL Close(); // derived
+ void Resize();
+
+public:
+
+ GHEditWindow();
+ GHEditWindow(Window * pParent, String aName = CUniString("Neues Fenster"), WinBits iWstyle = WB_STDWORK);
+
+ void Clear();
+ void AddText( String aNew, BOOL bMoveToEnd = TRUE);
+};
+
+
+
+class EditFileWindow : public GHEditWindow
+{
+
+ String aFileName;
+ virtual BOOL Close(); // derived
+ void LoadFile();
+
+public:
+ EditFileWindow(Window * pParent, String aName = CUniString("Neue Datei"), WinBits iWstyle = WB_STDWORK);
+
+};
+
+#endif
+
diff --git a/automation/source/miniapp/hid.lst b/automation/source/miniapp/hid.lst
new file mode 100644
index 000000000000..99964dba02e8
--- /dev/null
+++ b/automation/source/miniapp/hid.lst
@@ -0,0 +1,27 @@
+MENU_CLIENT 256
+IDM_FILE 1
+IDM_FILE_OPEN_TEST 2
+IDM_FILE_EXIT 3
+IDM_FILE_EXIT_HELP 0
+IDM_FILE_OPEN_TEST_HELP 1
+IDM_FILE_HELP 3
+GROSSER_TEST_DLG 256
+IDM_TEST 5
+IDM_TEST_GROSS 6
+IDM_SYS_DLG 7
+IDM_TEST_WINTREE 8
+
+
+
+UID_GROSSER_TEST_DLG 101
+UID_CheckBox 202
+UID_TriStateBox 303
+UID_OKButton 404
+UID_TimeField 505
+UID_MultiLineEdit 606
+UID_RadioButton1 707
+UID_RadioButton2 708
+UID_MultiListBox 809
+UID_ComboBox 910
+UID_DateBox 1011
+
diff --git a/automation/source/miniapp/makefile.mk b/automation/source/miniapp/makefile.mk
new file mode 100644
index 000000000000..2a6d2c2d5d78
--- /dev/null
+++ b/automation/source/miniapp/makefile.mk
@@ -0,0 +1,92 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1 $
+#
+# last change: $Author: mh $ $Date: 2002-11-18 11:17:42 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2002
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2002 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc..
+#
+# Copyright: 2002 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=AUTOMATION
+TARGET=miniapp
+
+# --- Settings ------------------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Allgemein ------------------------------------------------------------
+
+CXXFILES = \
+ testapp.cxx \
+ editwin.cxx \
+ servres.cxx \
+
+
+OBJFILES = \
+ $(OBJ)$/testapp.obj \
+ $(OBJ)$/editwin.obj \
+ $(OBJ)$/servres.obj \
+
+SRCFILES = \
+ servres.src
+
+# --- Targets ------------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/automation/source/miniapp/servres.cxx b/automation/source/miniapp/servres.cxx
new file mode 100644
index 000000000000..30aefee3d761
--- /dev/null
+++ b/automation/source/miniapp/servres.cxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: servres.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:17:48 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <string.h>
+
+#include "servres.hrc"
+#include "servuid.hxx"
+#include "servres.hxx"
+
+
+ModalDialogGROSSER_TEST_DLG::ModalDialogGROSSER_TEST_DLG( Window * pParent, const ResId & rResId, BOOL bFreeRes )
+ : ModalDialog( pParent, rResId ),
+ aCheckBox1( this, ResId( 1 ) ),
+ aTriStateBox1( this, ResId( 1 ) ),
+ aOKButton1( this, ResId( 1 ) ),
+ aTimeField1( this, ResId( 1 ) ),
+ aMultiLineEdit1( this, ResId( 1 ) ),
+ aGroupBox1( this, ResId( 1 ) ),
+ aRadioButton1( this, ResId( 1 ) ),
+ aRadioButton2( this, ResId( 2 ) ),
+ aMultiListBox1( this, ResId( 1 ) ),
+ aComboBox1( this, ResId( 1 ) ),
+ aDateBox1( this, ResId( 1 ) ),
+ aFixedText1( this, ResId( 1 ) )
+{
+ if( bFreeRes ) FreeResource();
+}
+
+MenuMENU_CLIENT::MenuMENU_CLIENT( const ResId & rResId, BOOL )
+ : MenuBar( rResId )
+{
+ // No subresources, automatic free resource
+}
+
diff --git a/automation/source/miniapp/servres.hrc b/automation/source/miniapp/servres.hrc
new file mode 100644
index 000000000000..8ff4838c447f
--- /dev/null
+++ b/automation/source/miniapp/servres.hrc
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * $RCSfile: servres.hrc,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:17:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+/* StarView ressource header file */
+#define MENU_CLIENT 256
+#define IDM_FILE 1
+#define IDM_FILE_OPEN_TEST 2
+#define IDM_FILE_EXIT 3
+#define IDM_FILE_EXIT_HELP 4
+#define IDM_FILE_OPEN_TEST_HELP 1
+#define IDM_FILE_HELP 3
+#define GROSSER_TEST_DLG 256
+#define IDM_TEST 5
+#define IDM_TEST_GROSS 6
+#define IDM_SYS_DLG 7
+#define IDM_TEST_WINTREE 8
+
diff --git a/automation/source/miniapp/servres.hxx b/automation/source/miniapp/servres.hxx
new file mode 100644
index 000000000000..5d080a3e2eef
--- /dev/null
+++ b/automation/source/miniapp/servres.hxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: servres.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:17:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SVEDIT_HXX
+#include <svtools/svmedit.hxx>
+#endif
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _FIELD_HXX //autogen
+#include <vcl/field.hxx>
+#endif
+#ifndef _EDIT_HXX //autogen
+#include <vcl/edit.hxx>
+#endif
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _COMBOBOX_HXX //autogen
+#include <vcl/combobox.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _MENU_HXX //autogen
+#include <vcl/menu.hxx>
+#endif
+#ifndef _LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+
+class ModalDialogGROSSER_TEST_DLG : public ModalDialog
+{
+protected:
+ CheckBox aCheckBox1;
+ TriStateBox aTriStateBox1;
+ OKButton aOKButton1;
+ TimeField aTimeField1;
+ MultiLineEdit aMultiLineEdit1;
+ GroupBox aGroupBox1;
+ RadioButton aRadioButton1;
+ RadioButton aRadioButton2;
+ MultiListBox aMultiListBox1;
+ ComboBox aComboBox1;
+ DateBox aDateBox1;
+ FixedText aFixedText1;
+public:
+ ModalDialogGROSSER_TEST_DLG( Window * pParent, const ResId & rResId, BOOL bFreeRes = TRUE );
+};
+
+class MenuMENU_CLIENT : public MenuBar
+{
+protected:
+public:
+ MenuMENU_CLIENT( const ResId & rResId, BOOL bFreeRes = TRUE );
+};
+
diff --git a/automation/source/miniapp/servres.src b/automation/source/miniapp/servres.src
new file mode 100644
index 000000000000..ebd2164bbc68
--- /dev/null
+++ b/automation/source/miniapp/servres.src
@@ -0,0 +1,267 @@
+/*************************************************************************
+ *
+ * $RCSfile: servres.src,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:18:04 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "servres.hrc"
+#include "servuid.hxx"
+ModalDialog GROSSER_TEST_DLG
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ HelpID = UID_GROSSER_TEST_DLG ;
+ Pos = MAP_APPFONT ( 14 , 7 ) ;
+ Size = MAP_APPFONT ( 273 , 110 ) ;
+ Text = "Groer Testdialog" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ CheckBox 1
+ {
+ HelpID = UID_CheckBox ;
+ Pos = MAP_APPFONT ( 9 , 17 ) ;
+ Size = MAP_APPFONT ( 55 , 12 ) ;
+ Text = "CheckBox" ;
+ TabStop = TRUE ;
+ };
+ TriStateBox 1
+ {
+ HelpID = UID_TriStateBox ;
+ Pos = MAP_APPFONT ( 9 , 29 ) ;
+ Size = MAP_APPFONT ( 62 , 12 ) ;
+ Text = "TriStateBox" ;
+ TabStop = TRUE ;
+ };
+ OKButton 1
+ {
+ HelpID = 1 ;
+ Pos = MAP_APPFONT ( 132 , 92 ) ;
+ Size = MAP_APPFONT ( 64 , 12 ) ;
+ TabStop = TRUE ;
+ };
+ TimeField 1
+ {
+ Border = TRUE ;
+ HelpID = UID_TimeField ;
+ Pos = MAP_APPFONT ( 9 , 92 ) ;
+ Size = MAP_APPFONT ( 40 , 12 ) ;
+ TabStop = TRUE ;
+ Spin = TRUE ;
+ };
+ MultiLineEdit 1
+ {
+ Border = TRUE ;
+ HelpID = UID_MultiLineEdit ;
+ Pos = MAP_APPFONT ( 172 , 6 ) ;
+ Size = MAP_APPFONT ( 94 , 48 ) ;
+ Text = "MultiLineEdit" ;
+ TabStop = TRUE ;
+ VScroll = TRUE ;
+ };
+ GroupBox 1
+ {
+ Pos = MAP_APPFONT ( 9 , 42 ) ;
+ Size = MAP_APPFONT ( 58 , 44 ) ;
+ Text = "GroupBox" ;
+ Group = TRUE ;
+ };
+ RadioButton 2
+ {
+ HelpID = UID_RadioButton2 ;
+ Pos = MAP_APPFONT ( 16 , 68 ) ;
+ Size = MAP_APPFONT ( 40 , 12 ) ;
+ Text = "Radio2" ;
+ TabStop = TRUE ;
+ };
+ RadioButton 1
+ {
+ HelpID = UID_RadioButton1 ;
+ Pos = MAP_APPFONT ( 16 , 54 ) ;
+ Size = MAP_APPFONT ( 42 , 12 ) ;
+ Text = "Radio1" ;
+ TabStop = TRUE ;
+ };
+ MultiListBox 1
+ {
+ Border = TRUE ;
+ HelpID = UID_MultiListBox ;
+ Pos = MAP_APPFONT ( 76 , 6 ) ;
+ Size = MAP_APPFONT ( 86 , 48 ) ;
+ TabStop = TRUE ;
+ StringList =
+ {
+ < "MultiListBox" ; Default ; > ;
+ < "Zeile 2" ; Default ; > ;
+ < "Zeile 3" ; Default ; > ;
+ < "Zeile 4" ; Default ; > ;
+ < "Zeile 5" ; Default ; > ;
+ < "Zeile 6" ; Default ; > ;
+ < "Zeile 7" ; Default ; > ;
+ < "Zeile 8" ; Default ; > ;
+ < "Zeile 9" ; Default ; > ;
+ < "Zeile 10" ; Default ; > ;
+ };
+ };
+ ComboBox 1
+ {
+ HelpID = UID_ComboBox ;
+ Pos = MAP_APPFONT ( 76 , 58 ) ;
+ Size = MAP_APPFONT ( 86 , 55 ) ;
+ Text = "ComboBox" ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ AutoHScroll = TRUE ;
+ StringList =
+ {
+ "ComboBox" ;
+ "Erster" ;
+ "Zweiter" ;
+ "Dritter" ;
+ };
+ };
+ DateBox 1
+ {
+ HelpID = UID_DateBox ;
+ Pos = MAP_APPFONT ( 76 , 72 ) ;
+ Size = MAP_APPFONT ( 86 , 54 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ AutoHScroll = TRUE ;
+ StringList =
+ {
+ "1.1.91" ;
+ "2.2.92" ;
+ "3.3.93" ;
+ };
+ };
+ FixedText 1
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT ( 19 , 6 ) ;
+ Size = MAP_APPFONT ( 39 , 9 ) ;
+ Text = "FixedText" ;
+ Center = TRUE ;
+ };
+ CancelButton 1
+ {
+ Pos = MAP_APPFONT ( 202 , 92 ) ;
+ Size = MAP_APPFONT ( 64 , 12 ) ;
+ TabStop = TRUE ;
+ };
+};
+Menu MENU_CLIENT
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = IDM_FILE ;
+ HelpID = IDM_FILE_HELP ;
+ Text = "~File" ;
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = IDM_FILE_OPEN_TEST ;
+ HelpID = IDM_FILE_OPEN_TEST_HELP ;
+ Text = "~Open Test Window" ;
+ };
+ MenuItem
+ {
+ Identifier = 4 ;
+ Separator = TRUE ;
+ };
+ MenuItem
+ {
+ Identifier = IDM_FILE_EXIT ;
+ HelpID = IDM_FILE_EXIT_HELP ;
+ Text = "~Beenden" ;
+ AccelKey = KeyCode
+ {
+ Code = KEY_F4 ;
+ Modifier2 = TRUE ;
+ };
+ };
+ };
+ };
+ };
+ MenuItem
+ {
+ Identifier = IDM_TEST ;
+ Text = "~Test" ;
+ SubMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = IDM_TEST_GROSS ;
+ Text = "~Groer Testdialog" ;
+ };
+ MenuItem
+ {
+ Identifier = IDM_SYS_DLG ;
+ Text = "~Sysdialoge" ;
+ };
+ };
+ };
+ };
+ };
+};
+
diff --git a/automation/source/miniapp/servuid.hxx b/automation/source/miniapp/servuid.hxx
new file mode 100644
index 000000000000..5da965e2bac8
--- /dev/null
+++ b/automation/source/miniapp/servuid.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * $RCSfile: servuid.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:18:09 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define UID_GROSSER_TEST_DLG 101
+#define UID_CheckBox 202
+#define UID_TriStateBox 303
+#define UID_OKButton 404
+#define UID_TimeField 505
+#define UID_MultiLineEdit 606
+#define UID_RadioButton1 707
+#define UID_RadioButton2 708
+#define UID_MultiListBox 809
+#define UID_ComboBox 910
+#define UID_DateBox 1011
diff --git a/automation/source/miniapp/test.bas b/automation/source/miniapp/test.bas
new file mode 100644
index 000000000000..f454807cf2a8
--- /dev/null
+++ b/automation/source/miniapp/test.bas
@@ -0,0 +1,135 @@
+sub main
+
+wintree
+' cMassentest
+ cTestdialog
+ cSysDlgTest
+ cFileOpenTest
+ SidWintree
+
+ FileExit
+end sub
+
+testcase cMassentest
+DisplayHid
+resetapplication
+FileDialog
+kontext "GrosserTestDlg"
+dim c,t,lang,i
+c = 0
+lang = "0123456789abcdef"
+lang = lang + lang
+lang = lang + lang
+lang = lang + lang
+lang = lang + lang
+lang = lang + lang
+lang = lang + lang
+
+lang = lang + lang
+lang = lang + lang
+'lang = lang + lang
+'lang = lang + lang
+'lang = lang + lang
+'print len(lang)
+nodebug
+while 1
+ c = c + 1
+ t = str(c)
+ MultiLineEdit.SetText t
+ CheckBox.check lang
+ CheckBox.uncheck lang
+ for i = 1 to 200 : next
+ beep
+wend
+
+endcase
+
+
+testcase cFileOpenTest
+
+ FileOpenTest
+ wintree
+ kontext
+ active.cancel
+
+endcase
+
+
+testcase cSysDlgTest
+
+ SysDialogs
+ wintree
+ kontext
+ active.yes
+ wintree
+ active.ok
+ active.Cancel
+
+ SysDialogs
+ active.Cancel
+ active.ok
+
+endcase
+
+testcase cTestdialog
+
+ FileDialog
+
+ kontext "GrosserTestDlg"
+ CheckBox.uncheck
+ TriStateBox.tristate
+ 'OKButton
+' TimeField.settext("fhsdjk")
+ MultiLineEdit.SetText "Das war der Text: '"+MultiLineEdit.GetText+"'"
+ RadioButton1.check
+ RadioButton2.check
+' MultiListBox.select 2
+ ComboBox.select("Dritter")
+ DateBox.select("1.1.91")
+
+ GrosserTestDlg.ok
+
+endcase
+
+
+sub LoadIncludeFiles
+' start "d:\prj\actual\basic\source\testtool\server\debug\server.exe"
+ start "d:\office40.vcl\miniapp.exe"
+
+
+ use "test.win"
+ use "test.sid"
+
+ testexit
+
+end sub
+
+sub testenter
+end sub
+
+sub testexit
+' if GrosserTestDlg.exists (1) then
+' GrosserTestDlg.ok
+' endif
+
+ dim xx
+ xx = GetNextError
+ if xx > "" then print xx
+ xx = resetapplication
+ if xx > "" then warnlog xx
+
+end sub
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/automation/source/miniapp/test.sid b/automation/source/miniapp/test.sid
new file mode 100644
index 000000000000..3af8966aa06b
--- /dev/null
+++ b/automation/source/miniapp/test.sid
@@ -0,0 +1,5 @@
+FileOpenTest IDM_FILE_OPEN_TEST
+FileExit IDM_FILE_EXIT
+FileDialog IDM_TEST_GROSS
+SidWintree IDM_TEST_WINTREE
+SysDialogs IDM_SYS_DLG
diff --git a/automation/source/miniapp/test.win b/automation/source/miniapp/test.win
new file mode 100644
index 000000000000..224ca5ad2d44
--- /dev/null
+++ b/automation/source/miniapp/test.win
@@ -0,0 +1,13 @@
+*active
+*GrosserTestDlg UID_GROSSER_TEST_DLG
+CheckBox UID_CheckBox
+TriStateBox UID_TriStateBox
+OKButton UID_OKButton
+TimeField UID_TimeField
+MultiLineEdit UID_MultiLineEdit
+RadioButton1 UID_RadioButton1
+RadioButton2 UID_RadioButton2
+MultiListBox UID_MultiListBox
+ComboBox UID_ComboBox
+DateBox UID_DateBox
+
diff --git a/automation/source/miniapp/testapp.cxx b/automation/source/miniapp/testapp.cxx
new file mode 100644
index 000000000000..ce1e7d58ab72
--- /dev/null
+++ b/automation/source/miniapp/testapp.cxx
@@ -0,0 +1,313 @@
+/*************************************************************************
+ *
+ * $RCSfile: testapp.cxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:18:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVT_FILEDLG_HXX //autogen
+#include <svtools/filedlg.hxx>
+#endif
+
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef SVTOOLS_TESTTOOL_HXX //autogen
+#include <svtools/testtool.hxx>
+#endif
+#ifndef _SVTOOLS_TTPROPS_HXX // handmade
+#include <svtools/ttprops.hxx>
+#endif
+
+#include "servres.hrc"
+#include "servres.hxx"
+#include "testapp.hxx"
+
+
+MainWindow::MainWindow(MyApp *pAppl)
+: WorkWindow(NULL, WB_APP | WB_STDWORK)
+, pApp(pAppl)
+{}
+
+IMPL_LINK(MainWindow,MenuSelectHdl,MenuBar*,aMenu)
+{
+
+ return pApp->GetDispatcher()->ExecuteFunction(aMenu->GetCurItemId());
+
+}
+
+void MainWindow::FileOpen()
+{
+ FileDialog Dlg(this,WB_OPEN );
+
+ Dlg.AddFilter(CUniString("Alle Dateien"), CUniString("*.*"));
+ Dlg.SetCurFilter (CUniString("*.*"));
+
+ if (Dlg.Execute() == RET_OK)
+ {
+
+ EditFileWindow * aEditWin = new EditFileWindow(this,Dlg.GetPath());
+
+ }
+}
+
+
+void MainWindow::TestGross()
+{
+ ModalDialogGROSSER_TEST_DLG Dlg(this,ResId(GROSSER_TEST_DLG));
+
+ if (Dlg.Execute() == RET_OK)
+ {
+ }
+}
+
+
+BOOL MainWindow::Close()
+{
+ WorkWindow::Close();
+ FileExit();
+ return TRUE;
+}
+
+void MainWindow::FileExit()
+{
+/* WriteSTBProfile();*/
+
+// if (pApp->CloseAll())
+ pApp->Quit();
+}
+
+
+void MainWindow::Tree(GHEditWindow *aEditWin, Window *pBase, int Indent)
+{
+ String sIndent,aText;
+ sIndent.Expand(5*Indent);
+
+ aText = pBase->GetText();
+ aText.SearchAndReplaceAllAscii("\n",CUniString("\\n"));
+
+ aEditWin->AddText(String(sIndent).AppendAscii("Text: ").Append(aText).AppendAscii("\n"));
+ aEditWin->AddText(String(sIndent).AppendAscii("Help: ").Append(String::CreateFromInt64(pBase->GetHelpId())).AppendAscii(":").Append(pBase->GetQuickHelpText()).AppendAscii(":").Append(pBase->GetHelpText()).AppendAscii("\n"));
+
+ int i;
+ for (i = 0 ; i < pBase->GetChildCount() ; i++)
+ {
+ Tree(aEditWin,pBase->GetChild(i),Indent+1);
+ }
+}
+
+void MainWindow::WinTree()
+{
+
+ GHEditWindow * aEditWin = new GHEditWindow(this,CUniString("Window Tree"));
+ Tree(aEditWin,this,0);
+
+}
+
+void MainWindow::SysDlg()
+{
+
+ switch (QueryBox(this,WB_YES_NO_CANCEL | WB_DEF_YES, CUniString("Soll noch ein Dialog geffnet werden?")).Execute())
+ {
+ case RET_YES:
+ while ( WarningBox(this,WB_OK_CANCEL | WB_DEF_OK,CUniString("Das ist jetzt aber die letzte Box")).Execute() == RET_OK );
+ break;
+ case RET_NO:
+ break;
+ case RET_CANCEL:InfoBox(this,CUniString("Schade")).Execute();
+ break;
+ }
+
+/*
+
+#define WB_OK ((WinBits)0x0010)
+#define WB_OK_CANCEL ((WinBits)0x0020)
+#define WB_YES_NO ((WinBits)0x0040)
+#define WB_YES_NO_CANCEL ((WinBits)0x0080)
+#define WB_RETRY_CANCEL ((WinBits)0x0100)
+
+#define WB_DEF_OK ((WinBits)0x0200)
+#define WB_DEF_CANCEL ((WinBits)0x0400)
+#define WB_DEF_RETRY ((WinBits)0x0800)
+#define WB_DEF_YES ((WinBits)0x1000)
+#define WB_DEF_NO ((WinBits)0x2000)
+
+#define RET_OK TRUE
+#define RET_CANCEL FALSE
+#define RET_YES 2
+#define RET_NO 3
+#define RET_RETRY 4
+*/
+}
+
+MyApp aApp;
+
+MyApp::MyApp()
+{
+ pMainWin = NULL;
+}
+
+void MyApp::Property( ApplicationProperty& rProp )
+{
+ TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
+ if ( pTTProperties )
+ {
+ pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
+ switch ( pTTProperties->nActualPR )
+ {
+/* case TT_PR_SLOTS:
+ {
+ pTTProperties->nSidOpenUrl = SID_OPENURL;
+ pTTProperties->nSidFileName = SID_FILE_NAME;
+ pTTProperties->nSidNewDocDirect = SID_NEWDOCDIRECT;
+ pTTProperties->nSidCopy = SID_COPY;
+ pTTProperties->nSidPaste = SID_PASTE;
+ pTTProperties->nSidSourceView = SID_SOURCEVIEW;
+ pTTProperties->nSidSelectAll = SID_SELECTALL;
+ pTTProperties->nSidReferer = SID_REFERER;
+ pTTProperties->nActualPR = 0;
+ }
+ break;*/
+ case TT_PR_DISPATCHER:
+ {
+ PlugInDispatcher* pDispatcher = GetDispatcher();
+ if ( !pDispatcher )
+ pTTProperties->nActualPR = TT_PR_ERR_NODISPATCHER;
+ else
+ {
+ pDispatcher->SetExecuteMode(EXECUTEMODE_DIALOGASYNCHRON);
+ if ( pDispatcher->ExecuteFunction(
+ pTTProperties->mnSID, pTTProperties->mppArgs, pTTProperties->mnMode )
+ == EXECUTE_NO )
+ pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
+ else
+ pTTProperties->nActualPR = 0;
+ }
+ }
+ break;
+/* case TT_PR_IMG:
+ {
+ SvDataMemberObjectRef aDataObject = new SvDataMemberObject();
+ SvData* pDataBmp = new SvData( FORMAT_BITMAP );
+ pDataBmp->SetData( pTTProperties->mpBmp );
+ aDataObject->Append( pDataBmp );
+ aDataObject->CopyClipboard();
+ pTTProperties->nActualPR = 0;
+ }
+ break;*/
+ default:
+ {
+ pTTProperties->nPropertyVersion = 0;
+ }
+ }
+ return;
+ }
+}
+
+
+USHORT MyDispatcher::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode)
+{
+
+ switch (nSID)
+ {
+ case IDM_FILE_EXIT: pMainWin->FileExit(); break;
+ case IDM_FILE_OPEN_TEST: pMainWin->FileOpen(); break;
+ case IDM_TEST_GROSS: pMainWin->TestGross(); break;
+ case IDM_TEST_WINTREE: pMainWin->WinTree(); break;
+ case IDM_SYS_DLG: pMainWin->SysDlg(); break;
+ default:
+ {
+ DBG_ERROR1("Dispatcher kennt Funktion nicht %s",ByteString::CreateFromInt64(nSID).GetBuffer());
+ return EXECUTE_NO;
+ }
+
+ }
+ return EXECUTE_YES;
+}
+
+PlugInDispatcher* MyApp::GetDispatcher()
+{
+ return pMyDispatcher;
+}
+
+
+void MyApp::Main()
+{
+ ResMgr *pRes = new ResMgr( CUniString("miniapp.res") );
+ Resource::SetResManager( pRes );
+
+ MainWindow MainWin(this);
+ pMainWin = &MainWin;
+
+ MenuBar aMenu(ResId(MENU_CLIENT));
+ MainWin.SetMenuBar( &aMenu );
+ aMenu.SetSelectHdl(LINK(&MainWin, MainWindow, MenuSelectHdl));
+
+ MyDispatcher MyDsp(pMainWin);
+ pMyDispatcher = &MyDsp;
+
+ MainWin.SetText(CUniString("Star Division Test Tool Client Window"));
+ MainWin.Show();
+
+ RemoteControl aRC;
+
+ Execute();
+}
+
diff --git a/automation/source/miniapp/testapp.hxx b/automation/source/miniapp/testapp.hxx
new file mode 100644
index 000000000000..8dd23e401707
--- /dev/null
+++ b/automation/source/miniapp/testapp.hxx
@@ -0,0 +1,160 @@
+/*************************************************************************
+ *
+ * $RCSfile: testapp.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mh $ $Date: 2002-11-18 11:18:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2002
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2002 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2002 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TESTAPP_HXX
+#define _TESTAPP_HXX
+
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _FIELD_HXX //autogen
+#include <vcl/field.hxx>
+#endif
+#ifndef _EDIT_HXX //autogen
+#include <vcl/edit.hxx>
+#endif
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _COMBOBOX_HXX //autogen
+#include <vcl/combobox.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _MENU_HXX //autogen
+#include <vcl/menu.hxx>
+#endif
+#ifndef _WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SFXPOOLITEM_HXX
+#include <svtools/poolitem.hxx>
+#endif
+
+
+#include "editwin.hxx"
+
+
+#define EXECUTE_NO 0
+#define EXECUTE_POSSIBLE 1
+#define EXECUTE_YES 2
+#define EXECUTEMODE_ASYNCHRON 1
+#define EXECUTEMODE_DIALOGASYNCHRON 2
+
+
+class MyApp;
+class MainWindow : public WorkWindow
+{
+ MyApp *pApp;
+
+public:
+ MainWindow(MyApp *pAppl);
+ virtual BOOL Close(); // derived
+
+ void FileExit();
+ void FileOpen();
+ void TestGross();
+ void Tree(GHEditWindow *aEditWin, Window *pBase, int Indent);
+ void WinTree();
+ void SysDlg();
+ DECL_LINK(MenuSelectHdl,MenuBar*);
+
+};
+#define PlugInDispatcher MyDispatcher
+class MyDispatcher
+{
+ MainWindow *pMainWin;
+
+public:
+ MyDispatcher(MainWindow *MainWin) : pMainWin(MainWin) {};
+ ~MyDispatcher() {};
+ virtual USHORT ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs = 0, USHORT nMode = 0);
+ virtual void SetExecuteMode( USHORT nMode ) {}; // Ist hier sowieso egal
+};
+
+class MyApp : public Application
+{
+ PopupMenu *MyMenu;
+ Timer aCommandTimer;
+ PlugInDispatcher *pMyDispatcher;
+
+public:
+ MyApp();
+ void Main();
+
+ virtual void Property( ApplicationProperty& );
+ virtual PlugInDispatcher* GetDispatcher();
+
+ MainWindow *pMainWin;
+};
+
+// -----------------------------------------------------------------------
+
+extern MyApp aApp;
+
+#endif
+