AeIntFieldUI.h 1.68 KB
#ifndef __AeIntFieldUI__
#define __AeIntFieldUI__

#include "AeFieldUI.h"


class AeIntFieldUI : public AeFieldUI
{
public:
                        AeIntFieldUI (const char * name,
				      Boolean isEditable,
				      Boolean isSelectable,
				      Boolean isHierarchical,
				      TJustify justify,
				      TIntGetProc getProc,
				      TIntSetProc setProc);
                        AeIntFieldUI (const char * name,
				      Boolean isEditable,
				      Boolean isSelectable,
				      Boolean isHierarchical,
				      TJustify justify,
				      TIntGetProc getProc,
				      TIntSetProc setProc,
				      int min, int max, int def);
    virtual		~AeIntFieldUI (void);

    virtual int		GetMin (AeAsset *) { return fMin; }
    virtual int		GetMax (AeAsset *) { return fMax; }

    virtual void       	GetValueString (AeAsset *, String);
    virtual Boolean	SetValueString (AeAsset *, String);

    virtual Boolean	VerifyValueString (String);
    virtual Boolean	VerifyInput (XmTextVerifyCallbackStruct *, const char * prevStr);

    virtual Boolean	HandleButtonPress (AeBinEditor *, AeAssetUI *, XEvent *, TEditModifier);
    virtual void	HandleDoubleClick (AeBinEditor *, AeAssetUI *, XEvent *, TEditModifier);

protected:
    void		getBallisticsConsts (AeAssetUI *, int * pDelta,
					     int * pMin, int * pMax);
    void		getBallistics (int speed, int linearDelta,
				       int * delta, int * divisor);
    Boolean		incrementValue (AeBinEditor *, AeAssetUI *,
					int delta, int min, int max);
    Boolean		issign (char c, int pos) { return pos == 0 && (c == '-' || c == '+'); }

    TIntGetProc		fGetProc;
    TIntSetProc		fSetProc;

    int			fMin;
    int			fMax;
    int			fDefault;
};


#endif