Du bist nicht angemeldet.

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

Sheddex

unregistriert

1

10.05.2006, 18:05

Konfigurationsdialog programmieren

Ich habe vor einen Konfigurationsdialog zum Konfigurieren ( ;) ) zu programmieren... und eben dass ist das Problem. Ich habe (fast) ewig nach Tuturials gesucht, aber in jedem wurden Resourcen verwendet. Ich möchte diesen Dialog aber ohne Resourcen programmieren, alles soll im Code stehen.
Kennt jemand von euch ein Tutorial, in dem gezeigt wird wie man einen solchen Dialog ohne Resourcen erstellt?

Nox

Supermoderator

Beiträge: 5 272

Beruf: Student

  • Private Nachricht senden

2

10.05.2006, 18:16

Tutorials kenne ich nicht, aber braucht man eigentlich auch nicht. Man macht die einfachen Elemente alle mit CreateWindowEx. Für komplexere Elemente muss man dann schonmal genauer suchen. Wieso willst du es ohne Res machen? Die machen vieles einfacher ;)
PRO Lernkurs "Wie benutze ich eine Doku richtig"!
CONTRA lasst mal die anderen machen!
networklibbenc - Netzwerklibs im Vergleich | syncsys - Netzwerk lib (MMO-ready) | Schleichfahrt Remake | Firegalaxy | Sammelsurium rund um FPGA&Co.

Sheddex

unregistriert

3

10.05.2006, 19:34

Naja... wenn man absolut keine Ahnung hat kann man das nicht "einfach machen" ;)
Aber wenn "CreateWindowEx" das kann schau ich mal in der msdn danach... thanx auf jedenfall mal ;)

Ich will das ohen Resourcen machen weil ich den Code so klein wie möglich halten will und ich es außerdem so übersichtlicher finde - außerdem habe ich mal ein "Macht-alles-kleiner" Tutorial von nix da gelesen in dem stand dass sich die Entwickler früher noch Mühe gegeben haben, und ihre Programme klein gehalten haben... heutzutage ist echt alles zu groß ;)
Aber das wichtigste ist wie schon gesagt: Ich finde ees einfach übersichtlicher soviel wie möglich im Code zu haben...

Sheddex

unregistriert

4

10.05.2006, 21:53

Durch die msdn bin ich jetzt mehr verwirrter als schlauer geworden, und Tutorials hab' ich immer noch keine gefunden :(
In jedem Tutorial wird der Dialog nunmal mit einem Res-Editor erstellt...
Es wäre nun wirklich nett wenn jemand ein kleines Beispielprogramm posten könnte in dem nur ein Dialog erstellt wird... ein Button und eine Combobox wäre gut... Auswertungen für das Klicken auf einen Knopf brauche ich nicht... das wird in den Res-Tuts schon beschrieben... aber eben nicht das Erstellen eines Dialogs ohne Res-Editor :(

Beiträge: 774

Beruf: Student

  • Private Nachricht senden

5

10.05.2006, 22:01

Also ich hab mir eine grobe automatische Standartauswahl für meine DirectX -Programme gebastelt. So kann ich im Programm selbst alle Einstellungen auflisten. Ist vieleicht nicht die beste Lösung, aber so spar ich mir einen (wie ich mein) umständlichen Dialog.

Nox

Supermoderator

Beiträge: 5 272

Beruf: Student

  • Private Nachricht senden

6

11.05.2006, 10:09

Ein Button oder eine Combobox ist nichts anderes als ein Fenster in dem Hauptfenster. Welche Funktion das Fenster haben soll legt man per Fensterklasse fest. Man muss sich nur an diese Tabelle halten:

Zitat

Class Meaning
BUTTON Designates a small rectangular child window that represents a button the user can click to turn it on or off. Button controls can be used alone or in groups, and they can either be labeled or appear without text. Button controls typically change appearance when the user clicks them. For more information, see Buttons.

For a table of the button styles you can specify in the dwStyle parameter, see Button Styles.

COMBOBOX Designates a control consisting of a list box and a selection field similar to an edit control. When using this style, an application should either display the list box at all times or enable a drop-down list box. If the list box is visible, typing characters into the selection field highlights the first list box entry that matches the characters typed. Conversely, selecting an item in the list box displays the selected text in the selection field. For more information, see Combo Boxes.

For a table of the combo box styles you can specify in the dwStyle parameter, see Combo Box Styles.

EDIT Designates a rectangular child window into which the user can type text from the keyboard. The user selects the control and gives it the keyboard focus by clicking it or moving to it by pressing the TAB key. The user can type text when the edit control displays a flashing caret; use the mouse to move the cursor, select characters to be replaced, or position the cursor for inserting characters; or use the key to delete characters. For more information, see Edit Controls.

For a table of the edit control styles you can specify in the dwStyle parameter, see Edit Control Styles.

LISTBOX Designates a list of character strings. Specify this control whenever an application must present a list of names, such as filenames, from which the user can choose. The user can select a string by clicking it. A selected string is highlighted, and a notification message is passed to the parent window. For more information, see List Boxes.

For a table of the list box styles you can specify in the dwStyle parameter, see List Box Styles.

MDICLIENT Designates an MDI client window. This window receives messages that control the MDI application's child windows. The recommended style bits are WS_CLIPCHILDREN and WS_CHILD. Specify the WS_HSCROLL and WS_VSCROLL styles to create an MDI client window that allows the user to scroll MDI child windows into view. For more information, see Multiple Document Interface.
RichEdit Designates a Microsoft® Rich Edit 1.0 control. This window lets the user view and edit text with character and paragraph formatting, and can include embedded Component Object Model (COM) objects. For more information, see Rich Edit Controls.

For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles.

RICHEDIT_CLASS Designates a Rich Edit 2.0 control. This controls let the user view and edit text with character and paragraph formatting, and can include embedded COM objects. For more information, see Rich Edit Controls.

For a table of the rich edit control styles you can specify in the dwStyle parameter, see Rich Edit Control Styles.

SCROLLBAR Designates a rectangle that contains a scroll box and has direction arrows at both ends. The scroll bar sends a notification message to its parent window whenever the user clicks the control. The parent window is responsible for updating the position of the scroll box, if necessary. For more information, see Scroll Bars.

For a table of the scroll bar control styles you can specify in the dwStyle parameter, see Scroll Bar Control Styles.

STATIC Designates a simple text field, box, or rectangle used to label, box, or separate other controls. Static controls take no input and provide no output. For more information, see Static Controls.

For a table of the static control styles you can specify in the dwStyle parameter, see Static Control Styles.

PRO Lernkurs "Wie benutze ich eine Doku richtig"!
CONTRA lasst mal die anderen machen!
networklibbenc - Netzwerklibs im Vergleich | syncsys - Netzwerk lib (MMO-ready) | Schleichfahrt Remake | Firegalaxy | Sammelsurium rund um FPGA&Co.

koschka

Community-Fossil

Beiträge: 2 862

Wohnort: Dresden

Beruf: Student

  • Private Nachricht senden

7

11.05.2006, 11:56

die CreateWindow Funktion kommt dann logsciherweise meist in die WM_CREATE "Nachrichtenabteilung"


Müsste so funktionieren....

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    switch(message)
    {
    case WM_CREATE:
        hButton = (HWND)CreateWindow(L"Button", L"ButtonText",
                                    WS_CHILD | WS_VISIBLE | BS_FLAT,
                                    0,
                                    0,
                                    800, 600,
                                    hParentWindow,
                                    HMENU(ID_BUTTON1),
                                    hInstance, 
                                    NULL);

....

ext

Treue Seele

  • Private Nachricht senden

8

11.05.2006, 14:06

Zitat von »"koschka"«

die CreateWindow Funktion kommt dann logsciherweise meist in die WM_CREATE "Nachrichtenabteilung"


Müsste so funktionieren....

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
    switch(message)
    {
    case WM_CREATE:
        hButton = (HWND)CreateWindow(L"Button", L"ButtonText",
                                    WS_CHILD | WS_VISIBLE | BS_FLAT,
                                    0,
                                    0,
                                    800, 600,
                                    hParentWindow,
                                    HMENU(ID_BUTTON1),
                                    hInstance, 
                                    NULL);

....

Da verwendest du das CreateWindow-Makro, aber machst die Zeichenketten unportabel ;p

koschka

Community-Fossil

Beiträge: 2 862

Wohnort: Dresden

Beruf: Student

  • Private Nachricht senden

9

11.05.2006, 16:04

Du bist mein Held ;). Es ging doch nur darum es zu zeigen ;). Er solles ja nicht abkopieren und in eine 100$ teure Software packen ^^.

Sheddex

unregistriert

10

11.05.2006, 18:45

@koschka: Also mein Held ist er ;)
Deine Tabelle habe ich auch schon gefunden, aber ich hatte keine Ahnung wo und wie man es verwenden soll... jetzt bin ich um einiges schlauer...

ThanX @ all, ich werde es mir morgen mal gemütlich reinziehen ;)

Werbeanzeige