| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718 |
- #ifndef Fenster_H
- #define Fenster_H
- #include "Array.h"
- #include "Zeichnung.h"
- namespace Framework
- {
- class VScrollBar; //! Scroll.h
- class HScrollBar; //! Scroll.h
- class TextFeld; //! TextFeld.h
- class Rahmen; //! Rahmen.h
- class Bildschirm; //! Bildschirm.h
- class AlphaFeld; //! AlphaFeld.h
- class Schrift; //! Schrift.h
- class Text; //! Text.h
- class Bild; //! Bild.h
- class WFenster; //! from this file
- class WFensterArray; //! from this file
- class Fenster; //! from this file
- #ifdef WIN32
- //! Creates a normal window class of the Windows API
- //! \param hInst The HINSTANCE of the program (passed by the Framework to
- //! the start function in the Startparam structure)
- DLLEXPORT WNDCLASS F_Normal(HINSTANCE hInst);
- //! Creates a normal window class of the Windows API
- //! \param hInst The HINSTANCE of the program (passed by the Framework to
- //! the start function in the Startparam structure)
- DLLEXPORT WNDCLASSEX F_NormalEx(HINSTANCE hInst);
- //! Framework function that processes all messages from Windows or other
- //! processes
- DLLEXPORT LRESULT CALLBACK WindowProc(
- HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
- //! Starts a loop that processes user input. The loop runs until
- //! StopNachrichtenSchleife is called somewhere in the program
- DLLEXPORT void StartNachrichtenSchleife();
- //! Stops the execution of the framework's message loop.
- //! \param hwnd A handle to any framework window that can receive
- //! messages. Required to send a message so that StartNachrichtenSchleife
- //! stops waiting and exits immediately
- DLLEXPORT void StopNachrichtenSchleife(HWND hwnd);
- //! Translates a keycode sent by Windows into the character of the
- //! pressed key
- DLLEXPORT void CalculateEnteredString(
- int virtualKeyCode, int scanCode, TastaturEreignis& te);
- //! Class for a Windows API window
- class WFenster : public virtual ReferenceCounter
- {
- private:
- HWND hWnd; //! Handle to the window
- int style;
- void* makParam;
- void* sakParam;
- void* takParam;
- MausAktion mausAktion;
- std::function<void(void*, void*)> vCloseAktion;
- std::function<void(void*, void*)> nCloseAktion;
- TastaturAktion tastaturAktion;
- Bildschirm* screen;
- int mx, my;
- bool verschiebbar;
- HWND rahmen;
- HBITMAP bitmap;
- HDC hdc;
- public:
- //--Constructor--
- DLLEXPORT WFenster();
- //--Constructor--
- //! \param hwnd A handle to the window that should be managed by this
- //! class
- DLLEXPORT WFenster(HWND hWnd);
- //--Destructor--
- DLLEXPORT ~WFenster();
- //! Creates the window
- //! \param style The style of the window. Example: WS_OVERLAPPEDWINDOW
- //! (for a normal window) \param wc The Windows API window class from
- //! which a window should be created. Can be created with the F_Normal
- //! function. lpszClassName must have been set.
- DLLEXPORT void erstellen(int style, WNDCLASS wc);
- //! Creates the window
- //! \param exStyle The EX style of the window. Example:
- //! WS_EX_OVERLAPPEDWINDOW (for a normal window)
- //! \param style The style of the window. Example: WS_OVERLAPPEDWINDOW
- //! (for a normal window) \param wc The Windows API window class from
- //! which a window should be created. Can be created with the F_Normal
- //! function. lpszClassName must have been set.
- DLLEXPORT void erstellenEx(int exStyle, int style, WNDCLASSEX wc);
- //! Sets the display mode of the window
- //! \param mod The mode. Example: SW_SHOWNORMAL to show the window
- //! and SW_HIDE to minimize it
- DLLEXPORT void setAnzeigeModus(int mod);
- //! Sets the focus to the window so that keyboard input is received
- DLLEXPORT bool setFokus();
- //! Sets the position of the window on the screen
- //! \param pos The position in pixels
- DLLEXPORT void setPosition(const Punkt& pos);
- //! Sets the position of the window on the screen
- //! \param x The X position in pixels
- //! \param y The Y position in pixels
- DLLEXPORT void setPosition(int x, int y);
- //! Sets the size of the window on the screen
- //! \param gr\u00f6\u00dfe The size in pixels
- DLLEXPORT void setSize(Punkt& groesse);
- //! Sets the size of the window on the screen
- //! \param breite The width in pixels
- //! \param h\u00f6he The height in pixels
- DLLEXPORT void setSize(int breite, int hoehe);
- //! Sets the position and size of the window
- //! \param pos The position in pixels
- //! \param gr\u00f6\u00dfe The size in pixels
- DLLEXPORT void setBounds(const Punkt& pos, const Punkt& groesse);
- //! Sets the screen object used to forward keyboard and mouse input
- //! to the framework's objects. Must be called with 0 before the
- //! window is destroyed. \param screen The screen object
- DLLEXPORT void setBildschirm(Bildschirm* screen);
- //! Destroys the window
- DLLEXPORT void zerstoeren();
- //! Processes mouse messages. Calls MausAktion and forwards events
- //! to the screen with objects if MausAktion returns 1
- //! \param me The event triggered by the mouse input
- DLLEXPORT void doMausAktion(MausEreignis& me);
- //! Calls the pre-close callback function
- DLLEXPORT void doVSchliessAktion();
- //! Calls the post-close callback function
- DLLEXPORT void doNSchliessAktion();
- //! Processes keyboard messages. Calls TastaturAktion and forwards
- //! events to the screen with objects if TastaturAktion returns 1
- //! \param me The event triggered by the keyboard input
- DLLEXPORT void doTastaturAktion(TastaturEreignis& et);
- //! Makes the window frame visible if ladeRahmenFenster was called
- DLLEXPORT void doRestoreMessage();
- //! Sets the parameter passed to the callback function on a mouse event
- //! \param p The parameter
- DLLEXPORT void setMausEreignisParameter(void* p);
- //! Sets the parameter passed to the callback function on close
- //! \param p The parameter
- DLLEXPORT void setSchliessEreignisParameter(void* p);
- //! Sets the parameter passed to the callback function on a keyboard
- //! event
- //! \param p The parameter
- DLLEXPORT void setTastaturEreignisParameter(void* p);
- //! Sets the callback function to be called on a mouse event.
- //! If the callback returns 0 or was not set, the mouse event is not
- //! further processed by the window. The standard function __ret1ME
- //! can be used, defined in MausEreignis.h and always returns 1
- //! \param ak A pointer to the callback function
- DLLEXPORT void setMausAktion(MausAktion ak);
- //! Sets the callback function to be called before closing.
- //! \param ak A pointer to the callback function
- DLLEXPORT void setVSchliessAktion(std::function<void(void*, void*)> ak);
- //! Sets the callback function to be called after closing.
- //! \param ak A pointer to the callback function
- DLLEXPORT void setNSchliessAktion(std::function<void(void*, void*)> ak);
- //! Sets the callback function to be called on a keyboard event.
- //! If the callback returns 0 or was not set, the keyboard event is not
- //! further processed. The standard function __ret1TE can be used,
- //! defined in TastaturEreignis.h and always returns 1. Other standard
- //! functions are _nurNummernTE and _nurHexTE also from
- //! TastaturEreignis.h \param ak A pointer to the callback function
- DLLEXPORT void setTastaturAktion(TastaturAktion ak);
- //! Sets the handle to the window that should be managed by this class
- //! \param hwnd The handle
- DLLEXPORT void setFensterHandle(HWND hWnd);
- //! Specifies whether the window can be moved by dragging with the mouse
- //! \param verschiebbar 1 if the window may be moved
- DLLEXPORT void setVerschiebbar(bool verschiebbar);
- //! Sets a transparent frame around the window
- //! \param zBild An image containing the frame
- //! \param hins The HINSTANCE of the program (passed by the Framework to
- //! the start function in the Startparam structure)
- DLLEXPORT void ladeRahmenFenster(Bild* zBild,
- HINSTANCE
- hinst); //! sets a transparent frame around the window
- //! Returns the handle of the managed window
- DLLEXPORT HWND getFensterHandle() const;
- //! Returns the position of the window in pixels
- DLLEXPORT Punkt getPosition() const;
- //! Returns the size of the window in pixels
- DLLEXPORT Punkt getGroesse() const;
- //! Returns the size of the window body in pixels
- DLLEXPORT Punkt getKoerperGroesse() const;
- //! Returns the width of the window body in pixels
- DLLEXPORT int getKoerperBreite() const;
- //! Returns the height of the window body in pixels
- DLLEXPORT int getKoerperHoehe() const;
- //! Returns whether a callback function for a mouse event was set
- DLLEXPORT bool hatMausAktion() const;
- //! Returns whether a callback function for the event before
- //! closing the window was set
- DLLEXPORT bool hatVSchliessAktion() const;
- //! Returns whether a callback function for the event after
- //! closing the window was set
- DLLEXPORT bool hatNSchliessAktion() const;
- //! Returns whether a callback function for a keyboard event
- //! was set
- DLLEXPORT bool hatTastaturAktion() const;
- //! Returns the screen to whose drawings the events are forwarded
- DLLEXPORT Bildschirm* getBildschirm() const;
- //! Returns the screen without increased reference counter to whose
- //! drawings the events are forwarded
- DLLEXPORT Bildschirm* zBildschirm() const;
- //! Returns whether the window is movable
- DLLEXPORT bool istVerschiebbar() const;
- };
- //! Manages all Windows API windows in the framework
- class WFensterArray
- {
- private:
- WFensterArray* next;
- WFenster* This;
- public:
- //! Constructor
- DLLEXPORT WFensterArray();
- //! Destructor
- DLLEXPORT ~WFensterArray();
- //! Adds a new window
- //! \param fenster The window
- DLLEXPORT bool addFenster(WFenster* fenster);
- //! Removes a window
- //! \param fenster The window
- DLLEXPORT bool removeFenster(WFenster* fenster);
- //! Returns the next element
- DLLEXPORT WFensterArray* getNext();
- //! Sets the next element to 0
- DLLEXPORT void setNext0();
- //! Deletes the element
- DLLEXPORT void del();
- //! Sends the pre-close event to a specific window
- //! \param hWnd The handle to the window
- DLLEXPORT bool sendVSchliessMessage(HWND hWnd);
- //! Sends the post-close event to a specific window
- //! \param hWnd The handle to the window
- DLLEXPORT bool sendNSchliessMessage(HWND hwnd);
- //! Sends a mouse event to a specific window
- //! \param hWnd The handle to the window
- //! \param me The event triggered by the mouse input
- DLLEXPORT bool sendMausMessage(HWND hWnd, MausEreignis& me);
- //! Sends a keyboard event to a specific window
- //! \param hWnd The handle to the window
- //! \param me The event triggered by the keyboard input
- DLLEXPORT bool sendTastaturMessage(HWND hwnd, TastaturEreignis& te);
- //! Sends the event triggered by opening the window to a specific
- //! window \param hWnd The handle to the window
- DLLEXPORT bool sendRestoreMessage(HWND hwnd);
- //! Returns the window of this entry
- DLLEXPORT WFenster* getThis();
- };
- //! Creates a Windows API popup window with a message
- //! \param hWnd A handle to the window that should be blocked until
- //! the popup window is closed. Can be 0 \param titel The title
- //! of the popup window \param meldung The message to display in the
- //! window \param style Determines the icon displayed in the window.
- //! Example: MB_ICONERROR, MB_ICONINFORMATION
- DLLEXPORT void WMessageBox(
- HWND hWnd, Text* titel, Text* meldung, UINT style);
- #endif
- //! Window class in the program
- class Fenster : public Zeichnung
- {
- public:
- class Style : public Zeichnung::Style
- {
- public:
- //! Determines whether the window body has a background
- static const __int64 BodyHintergrund = 0x000000008;
- //! Determines whether alpha blending is used when drawing
- //! the body background
- static const __int64 BodyHAlpha = 0x000000010;
- //! Determines whether an image is used as the body background
- static const __int64 BodyHBild = 0x000000020;
- //! Determines whether the body has a color gradient
- static const __int64 BodyBuffered = 0x000000040;
- //! Determines whether the window has a title bar
- static const __int64 Titel = 0x000000080;
- //! Determines whether the title bar has a background
- static const __int64 TitelHintergrund = 0x000000100;
- //! Determines whether alpha blending is used when drawing
- //! the title background
- static const __int64 TitelHAlpha = 0x000000200;
- //! Determines whether an image is used for the title background
- static const __int64 TitelHBild = 0x000000400;
- //! Determines whether the title bar has a color gradient
- static const __int64 TitelBuffered = 0x000000800;
- //! Determines whether a close button is displayed in the title bar
- static const __int64 Closable = 0x000001000;
- //! Determines whether the close button has a background
- static const __int64 ClosingHintergrund = 0x000002000;
- //! Determines whether alpha blending is used when drawing
- //! the close button background
- static const __int64 ClosingHAlpha = 0x000004000;
- //! Determines whether an image is used for the close button background
- static const __int64 ClosingHBild = 0x000008000;
- //! Determines whether the close button has a color gradient
- static const __int64 ClosingBuffer = 0x000010000;
- //! Determines whether the close button has a color gradient
- //! while being pressed
- static const __int64 ClosingKlickBuffer = 0x000020000;
- //! Determines whether the user can move the window by holding
- //! the left mouse button in the title bar
- static const __int64 Beweglich = 0x000040000;
- //! Determines whether the user can change the width of the window
- //! by holding the left mouse button on the right or left window edge
- static const __int64 BreiteChangeable = 0x000080000;
- //! Determines whether the user can change the height of the window
- //! by holding the left mouse button on the top or bottom window edge
- static const __int64 HeightChangeable = 0x000100000;
- //! Determines whether the user can change the title bar height
- //! by holding the left mouse button on the bottom edge of the title bar
- static const __int64 TitelHeightChangeable = 0x000200000;
- //! Determines whether there is a minimum window width
- static const __int64 MinBr = 0x000400000;
- //! Determines whether there is a maximum window width
- static const __int64 MaxBr = 0x000800000;
- //! Determines whether there is a minimum window height
- static const __int64 MinHi = 0x001000000;
- //! Determines whether there is a maximum window height
- static const __int64 MaxHi = 0x002000000;
- //! Determines whether there is a minimum body width
- static const __int64 BodyMinBr = 0x004000000;
- //! Determines whether there is a maximum body width
- static const __int64 BodyMaxBr = 0x008000000;
- //! Determines whether there is a minimum body height
- static const __int64 BodyMinHi = 0x010000000;
- //! Determines whether there is a maximum body height
- static const __int64 BodyMaxHi = 0x020000000;
- //! Determines whether a scrollbar appears at the right window edge
- static const __int64 VScroll = 0x040000000;
- //! Determines whether a scrollbar appears at the bottom window edge
- static const __int64 HScroll = 0x080000000;
- //! Determines whether mouse events should also be processed by
- //! drawings behind the window
- static const __int64 METransparenz = 0x100000000;
- //! Determines whether the window has a border
- static const __int64 Rahmen = 0x200000000;
- //! Determines whether the left side of the window is fixed when
- //! the size is changeable
- static const __int64 LeftPositionFixed = 0x400000000;
- //! Determines whether the right side of the window is fixed when
- //! the size is changeable
- static const __int64 RightPositionFixed = 0x800000000;
- //! Determines whether the top side of the window is fixed when
- //! the size is changeable
- static const __int64 TopPositionFixed = 0x1000000000;
- //! Determines whether the bottom side of the window is fixed when
- //! the size is changeable
- static const __int64 BottomPositionFixed = 0x2000000000;
- //! Determines whether the position and size of the title text field
- //! should remain unchanged
- static const __int64 CustomTitle = 0x4000000000;
- //! Combines flags MinHeight, MaxHeight, MaxWidth, MaxHeight
- static const __int64 min_max = MinHi | MaxHi | MaxBr | MaxHi;
- //! Combines flags BodyMinWidth, BodyMaxWidth, BodyMinHeight,
- //! BodyMaxWidth
- static const __int64 body_min_max
- = BodyMinBr | BodyMaxBr | BodyMinHi | BodyMaxBr;
- //! Combines flags VScroll, HScroll
- static const __int64 scroll = VScroll | HScroll;
- //! Combines flags TitleHeightChangeable, HeightChangeable,
- //! WidthChangeable, Movable
- static const __int64 nichtfixiert = TitelHeightChangeable
- | HeightChangeable
- | BreiteChangeable | Beweglich;
- //! Combines flags Visible, Enabled, Border, Title,
- //! TitleBuffered, Closable, ClosingImage, ClosingClickBuffer,
- //! Movable
- static const __int64 normal
- = Sichtbar | Erlaubt | Rahmen | Titel | TitelBuffered | Closable
- | ClosingHBild | ClosingKlickBuffer | Beweglich
- | MEIgnoreVerarbeitet | MEIgnoreSichtbar | MEIgnoreParentInside
- | MEIgnoreInside;
- };
- private:
- MausAktion closingMe;
- void* closingMeParam;
- Rahmen* rahmen;
- TextFeld* titel;
- RCArray<Zeichnung>* members;
- int bgBodyColor;
- Bild* bgBodyPicture;
- AlphaFeld* bodyBuffer;
- int bgClosingFarbe;
- Bild* bgClosingBild;
- AlphaFeld* closeBuffer;
- AlphaFeld* closeKlickBuffer;
- VScrollBar* vScroll;
- HScrollBar* hScroll;
- Punkt min, max;
- Punkt kMin, kMax;
- bool closeKlick, klick;
- int moving;
- int mx, my;
- protected:
- //! Processes mouse messages
- //! \param me The event triggered by the mouse input
- DLLEXPORT void doMausEreignis(MausEreignis& me, bool userRet) override;
- public:
- //! Constructor
- DLLEXPORT Fenster();
- //! Destructor
- DLLEXPORT virtual ~Fenster();
- //! Sets a pointer to the window border
- //! \param ram The border
- DLLEXPORT void setRahmenZ(Rahmen* ram);
- //! Sets the color of the window border
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setRFarbe(int f);
- //! Sets the width of the window border
- //! \param br The width in pixels
- DLLEXPORT void setRBreite(int br);
- //! Sets the title of the window
- //! \param txt The text
- DLLEXPORT void setTitel(Text* txt);
- //! Sets a pointer to the title text
- //! \param txt The new text
- DLLEXPORT void setTitelZ(Text* txt);
- //! Sets the title of the window
- //! \param txt The text
- DLLEXPORT void setTitel(const char* txt);
- //! Sets a pointer to the TextFeld that draws the title text
- //! \param tf The TextFeld
- DLLEXPORT void setTTextFeldZ(TextFeld* tf);
- //! Sets the font used for the title
- //! \param schrift The font
- DLLEXPORT void setTSchriftZ(Schrift* schrift);
- //! Sets the color of the font used for the title
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setTSFarbe(int f);
- //! Sets the size of the font used for the title
- //! \param gr The height of a line in pixels
- DLLEXPORT void setTSSize(int gr);
- //! Sets the background color of the title
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setTBgFarbe(int f);
- //! Sets a pointer to the color gradient of the title
- //! \param af The color gradient
- DLLEXPORT void setTAlphaFeldZ(AlphaFeld* af);
- //! Sets the color of the color gradient of the title
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setTAfFarbe(int f);
- //! Sets the strength of the color gradient of the title
- //! \param st The strength
- DLLEXPORT void setTAfStrength(int st);
- //! Sets the background image of the title by copying
- //! \param b The image to copy
- DLLEXPORT void setTBgBild(Bild* b);
- //! Sets a pointer to the background image of the title
- //! \param b The image
- DLLEXPORT void setTBgBildZ(Bild* b);
- //! Sets a pointer to the border of the title
- //! \param ram The border
- DLLEXPORT void setTRahmenZ(Rahmen* ram);
- //! Sets the color of the border of the title
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setTRFarbe(int f);
- //! Sets the width of the border of the title
- //! \param br The width in pixels
- DLLEXPORT void setTRBreite(int br);
- //! Sets the background color of the body
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setKBgFarbe(int f);
- //! Sets the background image of the body by copying
- //! \param b The image to copy
- DLLEXPORT void setKBgBild(Bild* b);
- //! Sets a pointer to the background image of the body
- //! \param b The image
- DLLEXPORT void setKBgBildZ(Bild* b);
- //! Sets a pointer to the color gradient of the body
- //! \param af The color gradient
- DLLEXPORT void setKAlphaFeldZ(AlphaFeld* af);
- //! Sets the color of the color gradient of the body
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setKAfFarbe(int f);
- //! Sets the strength of the color gradient of the body
- //! \param st The strength
- DLLEXPORT void setKAfStrength(int st);
- //! Sets the parameter of the callback function called when the close
- //! button receives a mouse event \param param The parameter
- DLLEXPORT void setClosingMeParam(void* param);
- //! Sets the callback function called when the close button receives
- //! a mouse event. If the callback returns 0 or was not set, the mouse
- //! event is not further processed by the drawing. The window is not
- //! closed automatically but should be closed in the callback by calling
- //! removeStyle( Fenster::Style::Sichtbar );
- //! \param ak A pointer to the callback function
- DLLEXPORT void setClosingMe(MausAktion closingMe);
- //! Sets the background color of the close button
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setSBgFarbe(int f);
- //! Sets the background image of the close button by copying
- //! \param b The image to copy
- DLLEXPORT void setSBgBild(Bild* b);
- //! Sets a pointer to the background image of the close button
- //! \param b The image
- DLLEXPORT void setSBgBildZ(Bild* b);
- //! Sets a pointer to the color gradient of the close button
- //! \param af The color gradient
- DLLEXPORT void setSAlphaFeldZ(AlphaFeld* af);
- //! Sets the color of the color gradient of the close button
- //! \param f The color in A8R8G8B8 format
- DLLEXPORT void setSAfFarbe(int f);
- //! Sets the strength of the color gradient of the close button
- //! \param st The strength
- DLLEXPORT void setSAfStrength(int st);
- //! Sets a pointer to the color gradient used when clicking the
- //! close button \param af The color gradient
- DLLEXPORT void setSKAlphaFeldZ(AlphaFeld* af);
- //! Sets the color of the color gradient used when clicking the
- //! close button \param f The color in A8R8G8B8 format
- DLLEXPORT void setSKAfFarbe(int f);
- //! Sets the strength of the color gradient used when clicking the
- //! close button \param st The strength
- DLLEXPORT void setSKAfStrength(int st);
- //! Sets the minimum size of the window
- //! \param mx The minimum width in pixels
- //! \param my The minimum height in pixels
- DLLEXPORT void setMin(int mx, int my);
- //! Sets the minimum size of the window
- //! \param min The minimum width and height in pixels
- DLLEXPORT void setMin(const Punkt& min);
- //! Sets the maximum size of the window
- //! \param mx The maximum width in pixels
- //! \param my The maximum height in pixels
- DLLEXPORT void setMax(int mx, int my);
- //! Sets the maximum size of the window
- //! \param min The maximum width and height in pixels
- DLLEXPORT void setMax(const Punkt& max);
- //! Sets the minimum size of the window body
- //! \param mx The minimum width in pixels
- //! \param my The minimum height in pixels
- DLLEXPORT void setKMin(int mx, int my);
- //! Sets the minimum size of the window body
- //! \param min The minimum width and height in pixels
- DLLEXPORT void setKMin(const Punkt& min);
- //! Sets the maximum size of the window body
- //! \param mx The maximum width in pixels
- //! \param my The maximum height in pixels
- DLLEXPORT void setKMax(int mx, int my);
- //! Sets the maximum size of the window body
- //! \param min The maximum width and height in pixels
- DLLEXPORT void setKMax(const Punkt& max);
- //! Sets a pointer to the scrollbar at the bottom of the window
- //! \param hScroll The scrollbar
- DLLEXPORT void setHScrollBarZ(HScrollBar* hScroll);
- //! Sets a pointer to the scrollbar at the right of the window
- //! \param vScroll The scrollbar
- DLLEXPORT void setVScrollBarZ(VScrollBar* vScroll);
- //! Sets the maximum scroll width of the window body
- //! \param max The width in pixels
- DLLEXPORT void setHSBMax(int max);
- //! Sets the maximum scroll height of the window body
- //! \param max The height in pixels
- DLLEXPORT void setVSBMax(int max);
- //! Scrolls to a specific x position in the window body
- //! \param scroll The number of pixels the content should be shifted left
- DLLEXPORT void setHSBScroll(int scroll);
- //! Scrolls to a specific y position in the window body
- //! \param scroll The number of pixels the content should be shifted up
- DLLEXPORT void setVSBScroll(int scroll);
- //! Updates the horizontal scrollbar so that the max scroll size is set
- //! to the width of the content
- DLLEXPORT void updateHScroll();
- //! Updates the vertical scrollbar so that the max scroll size is set to
- //! the height of the content
- DLLEXPORT void updateVScroll();
- //! Adds a drawing to the window
- //! \param obj The drawing
- DLLEXPORT virtual void addMember(Zeichnung* obj);
- //! sets the position of a member to index. This changes the order of
- //! rendering and the order input events are processed
- DLLEXPORT void setMemberIndex(Zeichnung* zMember, int index);
- //! Removes a drawing from the window
- //! \param zObj The drawing (without increased reference counter)
- DLLEXPORT virtual void removeMember(Zeichnung* zObj);
- //! Removes all drawings from the window
- DLLEXPORT virtual void removeAll();
- //! Updates the object. Called by the framework
- //! \param tickVal The time in seconds since the last call
- //! of this function \return 1 if something changed
- //! and the image needs to be redrawn. 0 otherwise
- DLLEXPORT bool tick(double tickval) override;
- //! Processes keyboard messages
- //! \param me The event triggered by the keyboard input
- DLLEXPORT void doTastaturEreignis(TastaturEreignis& te) override;
- //! Draws the window to zRObj if it is visible
- //! \param zRObj The image to draw into
- DLLEXPORT void render(Bild& zRObj) override;
- //! Returns the inner width of the drawing in pixels
- DLLEXPORT int getInnenBreite() const override;
- //! Returns the inner height of the drawing in pixels
- DLLEXPORT int getInnenHeight() const override;
- //! Returns the border of the window
- DLLEXPORT Rahmen* getRahmen() const;
- //! Returns the border of the window without increased reference counter
- DLLEXPORT Rahmen* zRahmen() const;
- //! Returns the color of the window border in A8R8G8B8 format
- DLLEXPORT int getRFarbe() const;
- //! Returns the width of the window border in pixels
- DLLEXPORT int getRBreite() const;
- //! Returns the title of the window
- DLLEXPORT Text* getTitel() const;
- //! Returns the title of the window without increased reference counter
- DLLEXPORT Text* zTitel() const;
- //! Returns the TextFeld used to draw the title
- DLLEXPORT TextFeld* getTTextFeld() const;
- //! Returns the TextFeld without increased reference counter used
- //! to draw the title
- DLLEXPORT TextFeld* zTTextFeld() const;
- //! Returns the font used for the title
- DLLEXPORT Schrift* getTSchrift() const;
- //! Returns the font without increased reference counter used for the title
- DLLEXPORT Schrift* zTSchrift() const;
- //! Returns the font color of the title in A8R8G8B8 format
- DLLEXPORT int getTSFarbe() const;
- //! Returns the height of a line of the title in pixels
- DLLEXPORT int getTSSize() const;
- //! Returns the background color of the title in A8R8G8B8 format
- DLLEXPORT int getTBgFarbe() const;
- //! Returns the color gradient of the title
- DLLEXPORT AlphaFeld* getTAlphaFeld() const;
- //! Returns the color gradient of the title without increased reference counter
- DLLEXPORT AlphaFeld* zTAlphaFeld() const;
- //! Returns the color of the color gradient of the title in A8R8G8B8 format
- DLLEXPORT int getTAfFarbe() const;
- //! Returns the strength of the color gradient of the title
- DLLEXPORT int getTAfStrength() const;
- //! Returns the background image of the title
- DLLEXPORT Bild* getTBgBild() const;
- //! Returns the background image of the title without increased reference counter
- DLLEXPORT Bild* zTBgBild() const;
- //! Returns the border of the title
- DLLEXPORT Rahmen* getTRahmen() const;
- //! Returns the border of the title without increased reference counter
- DLLEXPORT Rahmen* zTRahmen() const;
- //! Returns the color of the title border in A8R8G8B8 format
- DLLEXPORT int getTRFarbe() const;
- //! Returns the width of the title border
- DLLEXPORT int getTRBreite() const;
- //! Returns the background color of the body
- DLLEXPORT int getKBgFarbe() const;
- //! Returns the background image of the body
- DLLEXPORT Bild* getKBgBild() const;
- //! Returns the background image of the body without increased reference counter
- DLLEXPORT Bild* zKBgBild() const;
- //! Returns the color gradient of the body
- DLLEXPORT AlphaFeld* getKAlphaFeld() const;
- //! Returns the color gradient of the body without increased reference counter
- DLLEXPORT AlphaFeld* zKAlphaFeld() const;
- //! Returns the color of the color gradient of the body in A8R8G8B8 format
- DLLEXPORT int getKAfFarbe() const;
- //! Returns the strength of the color gradient of the body
- DLLEXPORT int getKAfStrength() const;
- //! Returns the background color of the close button in A8R8G8B8 format
- DLLEXPORT int getSBgFarbe() const;
- //! Returns the background image of the close button
- DLLEXPORT Bild* getSBgBild() const;
- //! Returns the background image of the close button without increased
- //! reference counter
- DLLEXPORT Bild* zSBgBild() const;
- //! Returns the color gradient of the close button
- DLLEXPORT AlphaFeld* getSAlphaFeld() const;
- //! Returns the color gradient of the close button without increased
- //! reference counter
- DLLEXPORT AlphaFeld* zSAlphaFeld() const;
- //! Returns the color of the color gradient of the close button in
- //! A8R8G8B8 format
- DLLEXPORT int getSAfFarbe() const;
- //! Returns the strength of the color gradient of the close button
- DLLEXPORT int getSAfStrength() const;
- //! Returns the color gradient used when the close button is pressed
- DLLEXPORT AlphaFeld* getSKAlphaFeld() const;
- //! Returns the color gradient without increased reference counter
- //! used when the close button is pressed
- DLLEXPORT AlphaFeld* zSKAlphaFeld() const;
- //! Returns the color of the color gradient in A8R8G8B8 format
- //! used when the close button is pressed
- DLLEXPORT int getSKAfFarbe() const;
- //! Returns the strength of the color gradient used when the close
- //! button is pressed
- DLLEXPORT int getSKAfStrength() const;
- //! Returns the minimum window size in pixels
- DLLEXPORT const Punkt& getMin() const;
- //! Returns the maximum window size in pixels
- DLLEXPORT const Punkt& getMax() const;
- //! Returns the minimum body size in pixels
- DLLEXPORT const Punkt& getKMin() const;
- //! Returns the maximum body size in pixels
- DLLEXPORT const Punkt& getKMax() const;
- //! Returns the scrollbar from the right window edge
- DLLEXPORT VScrollBar* getVScrollBar() const;
- //! Returns the scrollbar from the right window edge without increased
- //! reference counter
- DLLEXPORT VScrollBar* zVScrollBar() const;
- //! Returns the scrollbar from the bottom window edge
- DLLEXPORT HScrollBar* getHScrollBar() const;
- //! Returns the scrollbar from the bottom window edge without increased
- //! reference counter
- DLLEXPORT HScrollBar* zHScrollBar() const;
- //! Returns a list of drawings contained in the window
- DLLEXPORT const RCArray<Zeichnung>& getMembers() const;
- //! Returns the width needed by the children of the window
- DLLEXPORT int getNeededChildWidth() const;
- //! Returns the height needed by the children of the window
- DLLEXPORT int getNeededChildHeight() const;
- //! Creates a copy of the window that can be modified without
- //! affecting the original
- DLLEXPORT Zeichnung* dublizieren() const override;
- };
- } // namespace Framework
- #endif
|