Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#ifndef _GUIELEMENT_H #define _GUIELEMENT_H #include <string> #include "GUI_Base.h" class GUI_Base; class GUI_Element { public: GUI_Element(); ~GUI_Element(); virtual void Add(GUI_Base* pGUI_Base, int height, int width, std::string Text, bool bFlag) = 0; virtual void Render() = 0; }; #endif |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#ifndef _GUICOMBOBOX_H #define _GUICOMBOBOX_H #include "GUI_Base.h" #include "GUI_Element.h" #include <string> #include <list> const int MAX_ITEMS = 8; class GUI_Base; class GUI_ComboBox:public GUI_Element { struct SItem { std::string Text; bool Flag; }; public: GUI_ComboBox(); ~GUI_ComboBox(); ... |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#ifndef _GUIBASE_H #define _GUIBASE_H #include "framework.h" #include <string> #include <list> #include "GUI_Area.h" class GUI_Element; class GUI_ComboBox; class GUI_Base { friend GUI_ComboBox; public: GUI_Base(); ~GUI_Base(); GUI_Element* AddComboBox(dus::ivec2 Position, std::string SText); void DrawArea(dus::ivec2 Pos, dus::ivec2 Size, DWORD Color); protected: dus::Surface* m_pIconPic; // Surface für die Icon Grafiken dus::Font* m_pSystemFont; // Definiert den Font für Systemmenüs dus::ivec2 m_IconPos[ICON_NUM]; // Position der Icons auf der Surface private: std::list<GUI_Element*> m_Elements; // Liste mit den erzeugten GUI Elementen }; #endif |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 |
#ifndef _GUIAREA_H #define _GUIAREA_H #include "framework.h" #include "GUI_Base.h" #include "GUI_Element.h" #include "GUI_ComboBox.h" #endif |
Werbeanzeige