#ifndef Knopf_H #define Knopf_H #include "TextFeld.h" namespace Framework { class TextFeld; //! TextFeld.h class AlphaFeld; //! AlphaFeld.h class Text; //! Text.h class Schrift; //! Schrift.h class Rahmen; //! Rahmen.h class LTDBDatei; //! Dateisystem.h class Knopf; //! from this file class KontrollKnopf; //! from this file class TextRenderer; //! A 2D GUI Framework drawing that renders a button that the user can press class Knopf : public TextFeld { public: class Style : public ZeichnungHintergrund::Style { public: //! Specifies whether the button text may have multiple colors static const __int64 MehrfarbigText = 0x0010000; //! Specifies whether the button has a background color //! while being pressed static const __int64 KlickFarbe = 0x0020000; //! Specifies whether the button has a background image //! while being pressed static const __int64 KlickBild = 0x0040000; //! Specifies whether the button uses alpha blending //! for the background while being pressed static const __int64 KlickAlpha = 0x0080000; //! Specifies whether the button has a color gradient //! while being pressed static const __int64 KlickBuffer = 0x0100000; //! Combines flags Sichtbar, Erlaubt, Rahmen, //! Buffered, MehrfarbigText, KlickBuffer static const __int64 Normal = Sichtbar | Erlaubt | Rahmen | Buffered | MehrfarbigText | KlickBuffer; }; private: int klickFarbe; Bild* klickBild; AlphaFeld* klickBuffer; int klickIndex; //! Processes mouse messages //! \param me The event triggered by the mouse input DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override; public: //! Constructor DLLEXPORT Knopf(); //! Destructor DLLEXPORT virtual ~Knopf(); //! Sets the color used as background when the button is pressed //! \param fc The color in A8R8G8B8 format DLLEXPORT void setKlickFarbe(int fc); //! Sets the background image by copying, used when the button is pressed //! \param bild The image to copy DLLEXPORT void setKlickBild(Bild* bild); //! Sets a pointer to the background image used when the button is pressed //! \param bild The new image DLLEXPORT void setKlickBildZ(Bild* bild); //! Sets a pointer to the color gradient used when the button is pressed //! \param af The new color gradient DLLEXPORT void setKBZ(AlphaFeld* af); //! Sets the strength of the color gradient used when the button is pressed //! \param st The strength DLLEXPORT void setKBStrength(int st); //! Sets the color of the color gradient used when the button is pressed //! \param fc The color in A8R8G8B8 format DLLEXPORT void setKBFarbe(int fc); //! Verarbeitet Maus Nachrichten //! \param te Das Ereignis, was durch die Tastatur Eingabe ausgelößt //! wurde DLLEXPORT void doTastaturEreignis(TastaturEreignis& te) override; //! Draws the object to zRObj if it is visible //! \param zRObj The image to draw into DLLEXPORT void render(Bild& zRObj) override; //! Returns the background color in A8R8G8B8 format used when //! the button is pressed DLLEXPORT int getKlickFarbe() const; //! Returns the background image used when the button is pressed DLLEXPORT Bild* getKlickBild() const; //! Returns the background image without increased reference counter //! used when the button is pressed DLLEXPORT Bild* zKlickBild() const; //! Returns the color gradient used when the button is pressed DLLEXPORT AlphaFeld* getKB() const; //! Returns the color gradient without increased reference counter //! used when the button is pressed DLLEXPORT AlphaFeld* zKB() const; //! Returns the color of the color gradient in A8R8G8B8 format //! used when the button is pressed DLLEXPORT int getKBFarbe() const; //! Returns the strength of the color gradient used when the button //! is pressed DLLEXPORT int getKBStrength() const; //! Copies the button so it can be modified without affecting the original DLLEXPORT Zeichnung* dublizieren() const override; }; //! A 2D GUI Framework drawing that renders a selectable checkbox //! with label class KontrollKnopf : public ZeichnungHintergrund { public: class Style : public ZeichnungHintergrund::Style { public: //! Specifies whether the checkbox is selected static const __int64 Selected = 0x1000000; //! Specifies whether the label text can be multicolored static const __int64 MehrfarbigText = 0x001000; //! Specifies whether the checkbox has a background color //! while being pressed static const __int64 KlickFarbe = 0x002000; //! Specifies whether the checkbox has a background image //! when clicked static const __int64 KlickBild = 0x004000; //! Specifies whether alpha blending is used for the //! checkbox background when clicked static const __int64 KlickAlpha = 0x008000; //! Specifies whether the checkbox has a color gradient //! when clicked static const __int64 KlickBuffer = 0x010000; //! Specifies whether the checkbox has a background color //! while selected static const __int64 SelectFarbe = 0x020000; //! Specifies whether the checkbox has a background image //! while selected static const __int64 SelectBild = 0x040000; //! Specifies whether alpha blending is used for the //! checkbox background while selected static const __int64 SelectAlpha = 0x080000; //! Specifies whether the checkbox has a color gradient //! while selected static const __int64 SelectBuffer = 0x100000; //! Specifies whether the checkbox has a different label //! while selected static const __int64 SelectText = 0x200000; //! Specifies whether the checkbox can have a multi-line label static const __int64 MehrzeiligText = 0x400000; //! Specifies whether the checkbox is currently being clicked //! with the mouse. (Managed by the checkbox itself) static const __int64 MausKlick = 0x800000; //! Combines the flags Sichtbar, Erlaubt, Rahmen, //! KlickBuffer static const __int64 Normal = Sichtbar | Erlaubt | Rahmen | KlickBuffer; }; private: Text* txt; Text* sTxt; int sBgF; int kBgF; Bild* sBgB; Bild* kBgB; AlphaFeld* sAf; AlphaFeld* kAf; Bild* kasten; Bild* sKasten; TextRenderer* textRd; int sF; int sGr; //! Verarbeitet Maus Nachrichten //! \param me Das Ereignis, was durch die Mauseingabe ausgelößt wurde DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override; public: //! Konstruktor DLLEXPORT KontrollKnopf(); //! Destruktor DLLEXPORT virtual ~KontrollKnopf(); //! Setzt den Zeiger auf den Beschriftungs Text //! \param txt Der Text DLLEXPORT void setTextZ(Text* txt); //! Setzt den Beschriftungs Text //! \param txt Der Text DLLEXPORT void setText(Text* txt); //! Setzt den Beschriftungs Text //! \param txt Der Text DLLEXPORT void setText(const char* txt); //! Setzt den Zeiger auf den Beschriftungs Text, der angezeigt wird, //! während das Kästchen ausgewählt ist \param txt Der Text DLLEXPORT void setSTextZ(Text* txt); //! Setzt den Beschriftungs Text, der angezeigt wird, während das //! Kästchen ausgewählt ist \param txt Der Text DLLEXPORT void setSText(Text* txt); //! Setzt den Beschriftungs Text, der angezeigt wird, während das //! Kästchen ausgewählt ist \param txt Der Text DLLEXPORT void setSText(const char* txt); //! Setzt den verwendeten TextRenderer //! \param textRd Der Textrenderer DLLEXPORT void setTextRendererZ(TextRenderer* textRd); //! Setzt die Schrift, die für die Beschriftung verwendet werden soll //! \param schrift Die Schrift DLLEXPORT void setSchriftZ(Schrift* schrift); //! Setzt die Farbe der Schrift, die für die Beschriftung verwendet //! werden soll \param f Die Farbe im A8R8G8B8 Format DLLEXPORT void setSFarbe(int f); //! Setzt die Größe der Schrift, die für die Beschriftung verwendet //! werden soll \param f Die Höhe einer Zeile in Pixeln DLLEXPORT void setSSize(int gr); //! Setzt die Hintergrund Farbe, die verwendet wird, während das //! Kästchen ausgewählt ist \param f Die Farbe im A8R8G8B8 Format DLLEXPORT void setSBgFarbe(int f); //! Setzt die Hintergrund Farbe, die verwendet wird, während auf das //! Kästchen geklickt wird \param f Die Farbe im A8R8G8B8 Format DLLEXPORT void setKBgFarbe(int f); //! Setzt einen Zeiger auf das Hintergrund Bild, das verwendet wird, //! während das Kästchen ausgewählt ist \param b Das Bild DLLEXPORT void setSBgBildZ(Bild* b); //! Setzt das Hintergrund Bild durch kopieren, das verwendet wird, //! während das Kästchen ausgewählt ist \param b Das Bild, das kopiert //! werden soll DLLEXPORT void setSBgBild(Bild* b); //! Setzt einen Zeiger auf das Hintergrund Bild, das verwendet wird, //! während auf das Kästchen geklickt wird \param b Das Bild DLLEXPORT void setKBgBildZ(Bild* b); //! Setzt das Hintergrund Bild durch kopieren, das verwendet wird, //! während auf das Kästchen geklickt wird \param b Das Bild, das //! kopiert werden soll DLLEXPORT void setKBgBild(Bild* b); //! Setzt einen Zeiger auf den Farbübergang, der verwendet wird, während //! das Kästchen ausgewählt ist \param af Der Farbübergang DLLEXPORT void setSAlphaFeldZ(AlphaFeld* af); //! Setzt die Farbe des Farbübergangs, der verwendet wird, während das //! Kästchen ausgewählt ist \param f Die Farbe im A8R8G8B8 Format DLLEXPORT void setSAFFarbe(int f); //! Setzt die Stärke des Farbübergangs, der verwendet wird, während das //! Kästchen ausgewählt ist \param st Die Stärke DLLEXPORT void setSAFStrength(int st); //! Setzt einen Zeiger auf den Farbübergang, der verwendet wird, während //! auf das Kästchen geklickt wird \param af Der Farbübergang DLLEXPORT void setKAlphaFeldZ(AlphaFeld* af); //! Setzt die Farbe des Farbübergangs, der verwendet wird, während auf //! das Kästchen geklickt wird \param f Die Farbe im A8R8G8B8 Format DLLEXPORT void setKAFFarbe(int f); //! Setzt die Stärke des Farbübergangs, der verwendet wird, während auf //! das Kästchen geklickt wird \param st Die Stärke DLLEXPORT void setKAFStrength(int st); //! Lädt die Bilder "kasten.gif" und "skasten.gif" aus einer LTDB Datei //! Das Bild kasten.gif wird gezeichnet, wenn das Kästchen nicht //! ausgewählt ist. Das Bild skasten.gif wird gezeichnet, wenn das //! Kästchen ausgewählt wird \param zDat Die LTDB Datei DLLEXPORT void loadData(LTDBDatei* zDat); //! Lädt die Bilder "kasten.gif" und "skasten.gif" aus einer LTDB Datei //! Das Bild kasten.gif wird gezeichnet, wenn das Kästchen nicht //! ausgewählt ist. Das Bild skasten.gif wird gezeichnet, wenn das //! Kästchen ausgewählt wird \param ltdb Der Pfad zur LTDB Datei DLLEXPORT void loadData(const char* ltdb); //! Zeichnet das Objekt nach zRObj, falls es sichtbar ist //! \param zRObj Das Bild, in welches gezeichnet werden soll DLLEXPORT void render(Bild& zRObj) override; //! Gibt die beschriftung zurück DLLEXPORT Text* getText() const; //! Gibt die beschriftung ohne erhöhten Reference Counter zurück DLLEXPORT Text* zText() const; //! Gibt die beschriftung zurück, die verwendet wird, während das //! Kästchen ausgewählt ist DLLEXPORT Text* getSText() const; //! Gibt die beschriftung ohne erhöhten Reference Counter zurück, die //! verwendet wird, während das Kästchen ausgewählt ist DLLEXPORT Text* zSText() const; //! Gibt die verwendete Schrift zurück DLLEXPORT Schrift* getSchrift() const; //! Gibt die verwendete Schrift ohne Reference Counter zurück DLLEXPORT Schrift* zSchrift() const; //! Gibt die Schrift Farbe im A8R8G8B8 Format zurück DLLEXPORT int getSFarbe() const; //! Gibt die Schrift Größe zurück DLLEXPORT int getSSize() const; //! Gibt die Hintergrund Farbe im A8R8G8B8 Format zurück, die verwendet //! wird, während das Kästchen ausgewählt ist DLLEXPORT int getSBgFarbe() const; //! Gibt die Hintergrund Farbe im A8R8G8B8 Format zurück, die verwendet //! wird, während auf das Kästchen geklickt wird DLLEXPORT int getKBgFarbe() const; //! Gibt das Hintergrund Bild zurück, das verwendet wird, während das //! Kästchen ausgewählt ist DLLEXPORT Bild* getSBgBild() const; //! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, //! das verwendet wird, während das Kästchen ausgewählt ist DLLEXPORT Bild* zSBgBild() const; //! Gibt das Hintergrund Bild zurück, das verwendet wird, während auf //! das Kästchen geklickt wird DLLEXPORT Bild* getKBgBild() const; //! Gibt das Hintergrund Bild ohne erhöhten Reference Counter zurück, //! das verwendet wird, während auf das Kästchen geklickt wird DLLEXPORT Bild* zKBgBild() const; //! Gibt den Farbübergang zurück, der verwendet wird, während das //! Kästchen ausgewählt ist DLLEXPORT AlphaFeld* getSAlphaFeld() const; //! Gibt den Farbübergang ohne erhöhten Reference COunter zurück, der //! verwendet wird, während das Kästchen ausgewählt ist DLLEXPORT AlphaFeld* zSAlphaFeld() const; //! Gibt den Farbübergang zurück, der verwendet wird, während auf das //! Kästchen geklickt wird DLLEXPORT AlphaFeld* getKAlphaFeld() const; //! Gibt den Farbübergang ohne erhöhten Reference COunter zurück, der //! verwendet wird, während auf das Kästchen geklickt wird DLLEXPORT AlphaFeld* zKAlphaFeld() const; }; } // namespace Framework #endif