// @(#)Army.h	3.7 7/28/92

#ifndef ArmySymbols 

#ifdef __GNUG__
#pragma interface
#endif

#define ArmySymbols

#include "Dialog.h"
#include "Shape.h"


class ArmyShape : public Shape {
protected:
    static Font		*font;
    static int		h;

    Bitmap		*bm, *sbm;
    byte		*ns, *ss, *es, *ws;
    int			nl, sl, el, wl;
    class GeoPos	center;
    void		DrawCenterStr(Point p, byte *s, Font *font= font);

public:
    MetaDef(ArmyShape);

    const int margin= 10;
    const int im_w= 64;
    const int im_h= 40;
    virtual class Point	MinSize() const { return gPoint0; }
    void AreaChanged();
    ArmyShape();
    ~ArmyShape();
    void Init(Point pp1, Point pp2);
    short *GetImage();
    void Draw(Rectangle);
    void Moveby(Point delta);
#ifdef ET25
    OStream& PrintOn(OStream&);
    IStream& ReadFrom(IStream&);
#else
    ostream& PrintOn(ostream&);
    istream& ReadFrom(istream&);
#endif
};


//------ ArmySymbolDialog ------------------------------------------------------

enum ArmySymbolSize {
	eASSmall  = 0,
	eASMedium = 1,
	eASLarge  = 2
};

class ArmySymbolDialog: public Dialog {
    const int ETI_SIZE= 10;

    class OneOfCluster  *strength, 
			*type,
			*size;
#ifdef ET25
    class RegExpField	*north, *south, *west, *east;
#else
    class EditTextItem	*north, *south, *west;
    class RestrTextItem *east;
#endif
    class MyImageItem	*typeimageitem, *strengthimageitem;
    class Bitmap	**typebmp, **strengthbmp;
    bool    valid;
    int     oldsize,
	    oldtype,
	    oldstrength;
    char    oldnorth[ETI_SIZE+1], oldsouth[ETI_SIZE+1],
	    oldeast[ETI_SIZE+1] , oldwest[ETI_SIZE+1];
public:
    MetaDef(ArmySymbolDialog);

    ArmySymbolDialog();
    ~ArmySymbolDialog();

    //--- DIALOG ---
    VObject *DoCreateDialog();
    int ShowArmySymbolDialog(VObject*);
    void Control(int, int, void*);
    void DoSetDefaults();
    void DoSave();
    void DoRestore();
    void DoSetup();

    //--- INFO ---
    Bitmap *GetType();
    Bitmap *GetStrength();
    ArmySymbolSize GetSize();
    bool Valid();
    const char *north_str(), *south_str(), *east_str(), *west_str();
};
#endif ArmySymbols
