Source

gdt / SpriteEd / ImgDim.H

/* "Image dimensions" dialog controlling class */

#ifndef __INC_IMGDIM_H
#define __INC_IMGDIM_H
/*-------------------------------------------------------------------------*/
#include "NoPP.H" /* Stops C including this C++ only header */
#include "OwlStuff\SCDlg.H" // TSelfCenteringDialog

class TImgDimDlg : public TSelfCenteringDialog
{
public:
	TImgDimDlg(TWindow* parent=0, TModule* module=0);
protected:
	virtual void SetupWindow();

   // Event handlers
   void EvValuesChanged(); // Values have been changed
   void CmOk(); // This happens when OK is clicked
   void EvShowWindow(NATIVEBOOLTYPE show, uint stat);
private:
	// Controls
   	TEdit *WidthEdit, *HeightEdit, *BPPEdit;
   	TStatic* SizeResult;

   unsigned long GetBPPBox(); // Gets bits per pixel edit contents
   unsigned long GetWidthBox(); // Get width from edit box
   unsigned long GetHeightBox(); // Gets height from edit box
   void SetBPPBox(unsigned long newval); // Sets bits per pixel edit contents
   void SetWidthBox(unsigned long newval); // Sets width edit contents
   void SetHeightBox(unsigned long newval); // Sets height edit contents
   void EditBoxesToMembers(); // Copies visual numbers into private members (save states when OK clicked kind of thing)
   void MembersToEditBoxes(); // Copies private members to visual boxes for editing

   	unsigned long _BPP, _width, _height; /* Internal representations of numerics */
   	BYTE _noEditChangeEvents; /* If non-zero the edit boxes, when changed won't update the information bellow because our custom show proc doesn't work */ 

   DECLARE_RESPONSE_TABLE(TImgDimDlg);
};
DEFINE_RESPONSE_TABLE1(TImgDimDlg, TSelfCenteringDialog)
	EV_EN_CHANGE(IDC_HEIGHTEDIT, EvValuesChanged),
   EV_EN_CHANGE(IDC_WIDTHEDIT, EvValuesChanged),
   EV_EN_CHANGE(IDC_BPPEDIT, EvValuesChanged),
   EV_BN_CLICKED(IDOK, CmOk),
   EV_WM_SHOWWINDOW,
END_RESPONSE_TABLE;
/*-------------------------------------------------------------------------*/
#endif /*__INC_IMGDIM_H*/