#ifndef Fortschritt_H #define Fortschritt_H #include "Drawing.h" namespace Framework { class Rahmen; //! Border.h class AlphaFeld; //! AlphaField.h class Bild; //! Image.h class Schrift; //! Font.h class FBalken; //! from this file class TextRenderer; //! A 2D GUI framework drawing that renders a progress bar class FBalken : public ZeichnungHintergrund { public: class Style : public ZeichnungHintergrund::Style { public: //! Determines whether a percentage is drawn static const __int64 Prozent = 0x001000; //! Determines whether the action steps are drawn static const __int64 Aktionen = 0x01000000; //! Determines whether the progress-covered part of the bar has //! its own border static const __int64 FRahmen = 0x002000; //! Determines whether the progress-covered part of the bar has //! its own background color static const __int64 FFarbe = 0x004000; //! Determines whether the progress-covered part of the bar has //! its own background image static const __int64 FBild = 0x008000; //! Determines whether the progress-covered part of the bar uses //! alpha blending for drawing its background static const __int64 FAlpha = 0x10000; //! Determines whether the progress-covered part of the bar has //! its own color gradient static const __int64 FBuffered = 0x20000; //! Determines whether the progress expands from left to right static const __int64 L_R = 0x0100000; //! Determines whether the progress expands from right to left static const __int64 R_L = 0x0200000; //! Determines whether the progress expands from bottom to top static const __int64 U_O = 0x0400000; //! Determines whether the progress expands from top to bottom static const __int64 O_U = 0x0800000; //! Combines flags Visible, Border, Background, BackgroundImage, //! FBorder, FImage, L_R, Percent static const __int64 normal = Sichtbar | Rahmen | Hintergrund | HBild | FRahmen | FBild | L_R | Prozent | Aktionen | HBildScale; }; private: __int64 maxAk; __int64 ak; Rahmen* fRahmen; AlphaFeld* fBuffer; int fBgF; Bild* fBgBild; TextRenderer* textRd; int schriftFarbe; unsigned char schriftSize; public: //! Constructor DLLEXPORT FBalken(); //! Destructor DLLEXPORT virtual ~FBalken(); //! Sets the number of operations needed to reach 100% progress //! \param ak The number of operations DLLEXPORT void setAktionAnzahl(__int64 ak); //! Indicates that a certain number of operations have been performed //! since the last call \param aktionen The operations performed. //! Defaults to 1 DLLEXPORT void aktionPlus(__int64 aktionen = 1); //! Resets all completed operations so that progress starts from 0% again DLLEXPORT void reset(); //! Sets a pointer to the border drawn in the progress-covered part //! of the bar \param ram The border DLLEXPORT void setFRahmenZ(Rahmen* ram); //! Sets the color of the border drawn in the progress-covered part //! of the bar \param f The color in A8R8G8B8 format DLLEXPORT void setFRFarbe(int f); //! Sets the width of the border drawn in the progress-covered part //! of the bar \param br The width in pixels DLLEXPORT void setFRBreite(int br); //! Sets a pointer to the color gradient drawn in the progress-covered //! part of the bar \param af The color gradient DLLEXPORT void setFAlphaFeldZ(AlphaFeld* af); //! Sets the color of the color gradient drawn in the progress-covered //! part of the bar \param f The color in A8R8G8B8 format DLLEXPORT void setFAFFarbe(int f); //! Sets the strength of the color gradient drawn in the progress-covered //! part of the bar \param st The strength DLLEXPORT void setFAFStrength(int st); //! Sets the background color drawn in the progress-covered part //! of the bar \param f The color in A8R8G8B8 format DLLEXPORT void setFBgFarbe(int f); //! Sets a pointer to the background image drawn in the progress-covered //! part of the bar \param b The image DLLEXPORT void setFBgBildZ(Bild* b); //! Sets the background image by copying, drawn in the progress-covered //! part of the bar \param b The image to copy DLLEXPORT void setFBgBild(Bild* b); //! Sets the text renderer used //! \param textRd The text renderer DLLEXPORT void setTextRendererZ(TextRenderer* textRd); //! Sets the font used to draw the percentage display DLLEXPORT void setSchriftZ(Schrift* b); //! Sets the color of the percentage display //! \param f The color in A8R8G8B8 format DLLEXPORT void setSFarbe(int f); //! Sets the font size of the percentage display //! \param gr The height of a line in pixels DLLEXPORT void setSSize(unsigned char gr); //! Draws the object to zRObj if it is visible //! \param zRObj The image to draw into DLLEXPORT void render(Bild& zRObj) override; //! Returns the number of operations needed for 100% DLLEXPORT __int64 getAktionAnzahl() const; //! Returns the current percentage of progress DLLEXPORT double getProzent() const; //! Returns the number of completed operations DLLEXPORT __int64 getAktion() const; //! Returns the border drawn in the progress-covered part of the bar DLLEXPORT Rahmen* getFRahmen() const; //! Returns the border without increased reference counter drawn in the //! progress-covered part of the bar DLLEXPORT Rahmen* zFRahmen() const; //! Returns the color gradient drawn in the progress-covered part of the bar DLLEXPORT AlphaFeld* getFAlphaFeld() const; //! Returns the color gradient without increased reference counter drawn //! in the progress-covered part of the bar DLLEXPORT AlphaFeld* zFAlphaFeld() const; //! Returns the background color in A8R8G8B8 format drawn in the //! progress-covered part of the bar DLLEXPORT int getFBgFarbe() const; //! Returns the background image drawn in the progress-covered part //! of the bar DLLEXPORT Bild* getFBgBild() const; //! Returns the background image without increased reference counter //! drawn in the progress-covered part of the bar DLLEXPORT Bild* zFBgBild() const; //! Returns the font used for the percentage display DLLEXPORT Schrift* getSchrift() const; //! Returns the font without increased reference counter used for the //! percentage display DLLEXPORT Schrift* zSchrift() const; //! Returns the color of the percentage display in A8R8G8B8 format DLLEXPORT int getSFarbe() const; }; } // namespace Framework #endif