//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odother
//
//   CLASSES: none
//
//   ORIGINS: 27
//
//
//   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
//   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//   OR PERFORMANCE OF THIS SOFTWARE.
//
//====END_GENERATED_PROLOG========================================
//
// @(#) 1.1 nt/src/samples/JavaPart/propdlg.cpp, odjavapart, od96nt, odnt9712d 10/23/96 03:06:36 [ 3/21/97 17:41:06 ]

#ifndef IBMSample_PROPERTIESDIALOG
#include "PropDlg.h"
#endif

#ifndef IBMSample_TAG
#include "Tag.h"
#endif

#include "IODJava.h"


/*-------------------------------------------------------------------+
|               PropertiesDialog::PropertiesDialog ()                |
| ================================================================== |
|                                                                    |
| Function:    PropertiesDialog default constructor                  |
|                                                                    |
| Algorithm:   o  Set default values...                              |
|                                                                    |
+-------------------------------------------------------------------*/
PropertiesDialog::PropertiesDialog (HWND parentWindow) :
	Dialog (parentWindow, AppletProperties)
{
}


/*-------------------------------------------------------------------+
|                     PropertiesDialog::Get ()                       |
| ================================================================== |
|                                                                    |
| Function:    Display the properties dialog and return values...    |
|                                                                    |
| Parameters:  URL       -                                           |
|              className -                                           |
|              codeBase  -                                           |
|                                                                    |
| Returns:     (0)  Successfull                                      |
|              (-1) An error occurred                                |
|                                                                    |
+-------------------------------------------------------------------*/
int PropertiesDialog::Get (AppletTag* tag)
{
	int rc;

	strcpy (fUrl, tag->fUrl);
	strcpy (fCode, tag->fCode);
	strcpy (fCodeBase, tag->fCodeBase);

	if ((rc = Display ()) == TRUE) {
		tag->SetUrl (fUrl);
		tag->SetCode (fCode);
		tag->SetCodeBase (fCodeBase);
		tag->SetArgs (NULL);
	}
	return rc;
}


/*-------------------------------------------------------------------+
|                     PropertiesDialog::Init ()                      |
| ================================================================== |
|                                                                    |
| Function:    Initialize the properties dialog...                   |
|                                                                    |
+-------------------------------------------------------------------*/
void PropertiesDialog::Init (HWND window) 
{
	SetDlgItemText (window, ID_URL, fUrl);
	SetDlgItemText (window, ID_CLASS, fCode);
	SetDlgItemText (window, ID_CODEBASE, fCodeBase);
}


/*-------------------------------------------------------------------+
|                      PropertiesDialog::Ok ()                       |
| ================================================================== |
|                                                                    |
| Function:    "Ok" button was pressed, take action...               |
|                                                                    |
+-------------------------------------------------------------------*/
void PropertiesDialog::Ok (HWND window) 
{
	GetDlgItemText (window, ID_URL, fUrl, 255);
	GetDlgItemText (window, ID_CLASS, fCode, 255);
	GetDlgItemText (window, ID_CODEBASE, fCodeBase, 255);
}
