bussa.forums -2 Newbie Poster

how to use the FXPrintDialog class i create an object and for that constructor i passed one FXdialogbox object which i need print is it correct please help me any one
thanks in advance

#include <fx.h>

// Main Window PrintTestDialog
class  PrintTestDialog : public FXDialogBox
{

	// Macro for class hierarchy declarations
	FXDECLARE(PrintTestDialog)

private:

	FXApp *apps;
	FXVerticalFrame	*contents_frame,*user_border,*employee_border; // Content frame
	FXMatrix	*user_frame,*employee_frame;
	FXTextField			*name1,*name2,*age1,*age2,*salary1,*salary2;
	FXButton	*print_button;

	FXPrintDialog	*print_the_form;

protected:
	PrintTestDialog(){}

public:

	// Message handlers
	long onPressPrint(FXObject*,FXSelector,void*);

public:

	// Messages for our class
	enum
	{
		ID_PRINT_BUTTON=FXDialogBox::ID_LAST, 

	};

public:

	// PrintTestDialog's constructor
	PrintTestDialog(FXApp* a);

	virtual ~PrintTestDialog();
};



// Message Map for the paraDiag Window class
FXDEFMAP(PrintTestDialog) PrintTestDialogMap[]={

	//________Message_Type_____________________ID____________Message_Handler_______

	FXMAPFUNC(SEL_COMMAND,	PrintTestDialog::ID_PRINT_BUTTON, PrintTestDialog::onPressPrint),
	
};
#include "PrintTestDialog.h"
// Macro for the paraDiagApp class hierarchy implementation
FXIMPLEMENT(PrintTestDialog,FXDialogBox,PrintTestDialogMap,ARRAYNUMBER(PrintTestDialogMap))

// Construct a PrintTestDialog
PrintTestDialog::PrintTestDialog(FXApp *app_con):FXDialogBox(app_con,"Print Dialog",DECOR_ALL)
{
	contents_frame	=	new FXVerticalFrame(this);

	user_border		=	new FXVerticalFrame(contents_frame,FRAME_THICK|LAYOUT_FILL);
	employee_border		=	new FXVerticalFrame(contents_frame,FRAME_THICK|LAYOUT_FILL);

	user_frame		=	new	FXMatrix(user_border,2,MATRIX_BY_COLUMNS);
	employee_frame		=	new	FXMatrix(employee_border,2,MATRIX_BY_COLUMNS,FRAME_SUNKEN);

	new FXLabel(user_frame,"Name");
	name1	=	new FXTextField(user_frame,20);
	new FXLabel(user_frame,"Age");
	age1	=	new FXTextField(user_frame,20);
	new FXLabel(user_frame,"Salary");
	salary1	=	new FXTextField(user_frame,20);

	
	new FXLabel(employee_frame,"Name");
	name2	=	new FXTextField(employee_frame,20);
	new FXLabel(employee_frame,"Age");
	age2	=	new FXTextField(employee_frame,20);
	new FXLabel(employee_frame,"Salary");
	salary2	=	new FXTextField(employee_frame,20);


	print_button	= new FXButton(contents_frame,"Print",0,this,ID_PRINT_BUTTON,LAYOUT_CENTER_X|BUTTON_NORMAL);
	apps=app_con;


		print_the_form= new FXPrintDialog(this,"hello");//i dont know whether i have to put this or not
	
}

PrintTestDialog::~PrintTestDialog()
{

}

long PrintTestDialog::onPressPrint(FXObject*,FXSelector,void*)
{
	print_the_form->execute();
	return 1;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.