]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/dialog.qc
Merge branch 'master' into terencehill/dynamic_hud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / dialog.qc
index fc14d9222b1a76f1bd8535333da563d1cc54626c..c4a78fa568802c305e763aedca9e96eb59bfb595 100644 (file)
@@ -1,76 +1,9 @@
-// Note: this class is called Dialog, but it can also handle a tab under the following conditions:
-// - isTabRoot is 0
-// - backgroundImage is the tab's background
-// - closable is 0
-// - rootDialog is 0
-// - title is ""
-// - marginTop is
-// - intendedHeight ends up to be the tab's actual height, or at least close
-// - titleFontSize is 0
-// - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight)
-// To ensure the latter, you best create all tabs FIRST and insert the tabbed
-// control to your dialog THEN - with the right height
-//
-// a subclass may help with using this as a tab
-
-#ifndef ITEM_DIALOG_H
-       #define ITEM_DIALOG_H
-       #include "inputcontainer.qc"
-       CLASS(Dialog, InputContainer)
-               METHOD(Dialog, configureDialog, void(entity)); // no runtime configuration, all parameters are given in the code!
-               METHOD(Dialog, fill, void(entity));            // to be overridden by user to fill the dialog with controls
-               METHOD(Dialog, keyDown, float(entity, float, float, float));
-               METHOD(Dialog, close, void(entity));
-               METHOD(Dialog, addItemSimple, void(entity, float, float, float, float, entity, vector));
-
-               METHOD(Dialog, TD, void(entity, float, float, entity));
-               METHOD(Dialog, TDNoMargin, void(entity, float, float, entity, vector));
-               METHOD(Dialog, TDempty, void(entity, float));
-               METHOD(Dialog, setFirstColumn, void(entity, float));
-               METHOD(Dialog, TR, void(entity));
-               METHOD(Dialog, gotoRC, void(entity, float, float));
-
-               ATTRIB(Dialog, isTabRoot, float, 1)
-               ATTRIB(Dialog, closeButton, entity, NULL)
-               ATTRIB(Dialog, intendedHeight, float, 0)
-               ATTRIB(Dialog, itemOrigin, vector, '0 0 0')
-               ATTRIB(Dialog, itemSize, vector, '0 0 0')
-               ATTRIB(Dialog, itemSpacing, vector, '0 0 0')
-               ATTRIB(Dialog, currentRow, float, 0)
-               ATTRIB(Dialog, currentColumn, float, 0)
-               ATTRIB(Dialog, firstColumn, float, 0)
-
-               // to be customized
-               ATTRIB(Dialog, closable, float, 1)
-               ATTRIB(Dialog, title, string, "Form1")  // ;)
-               ATTRIB(Dialog, color, vector, '1 0.5 1')
-               ATTRIB(Dialog, intendedWidth, float, 0)
-               ATTRIB(Dialog, rows, float, 3)
-               ATTRIB(Dialog, columns, float, 2)
-
-               ATTRIB(Dialog, marginTop, float, 0)     // pixels
-               ATTRIB(Dialog, marginBottom, float, 0)  // pixels
-               ATTRIB(Dialog, marginLeft, float, 0)    // pixels
-               ATTRIB(Dialog, marginRight, float, 0)   // pixels
-               ATTRIB(Dialog, columnSpacing, float, 0) // pixels
-               ATTRIB(Dialog, rowSpacing, float, 0)    // pixels
-               ATTRIB(Dialog, rowHeight, float, 0)     // pixels
-               ATTRIB(Dialog, titleHeight, float, 0)   // pixels
-               ATTRIB(Dialog, titleFontSize, float, 0) // pixels; if 0, title causes no margin
-               ATTRIB(Dialog, zoomedOutTitleBarPosition, float, 0)
-               ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
-
-               ATTRIB(Dialog, requiresConnection, float, 0)  // set to true if the dialog requires a connection to be opened
-
-               ATTRIB(Dialog, backgroundImage, string, string_null)
-               ATTRIB(Dialog, borderLines, float, 1)
-               ATTRIB(Dialog, closeButtonImage, string, string_null)
-
-               ATTRIB(Dialog, frame, entity, NULL)
-       ENDCLASS(Dialog)
-#endif
-
-#ifdef IMPLEMENTATION
+#include "dialog.qh"
+
+#include "borderimage.qh"
+#include "button.qh"
+#include "nexposee.qh"
+
        void Dialog_Close(entity button, entity me)
        {
                me.close(me);
                }
                return SUPER(Dialog).keyDown(me, key, ascii, shift);
        }
-#endif