News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Dialogs

Started by LordAdef, April 14, 2019, 05:02:42 AM

Previous topic - Next topic

LordAdef

Hey guys!
Because of lack of time, I decided to tackle something easier that is still missing in my game.
..Dialogs..
Games need cool Dialogs, not those boring Windows ones.
Instead of finding out how to customize/learn the Windows way of doing it, I decided to code my own dialogs.

If anyone has any interest, I'll be happy to clean and share the code.
Although mine is already working, I am interest in knowing different solutions for this topic. Please let me know.
For now I'd like to ask: What's the conventional behaviour for bringing the dialogs up, on "mouse down" or "mouse up"?
Cheers Alex

jj2007

Quote from: LordAdef on April 14, 2019, 05:02:42 AMWhat's the conventional behaviour for bringing the dialogs up, on "mouse down" or "mouse up"?
Click here to find out.

LordAdef

Quote from: jj2007 on April 14, 2019, 12:18:06 PM
Quote from: LordAdef on April 14, 2019, 05:02:42 AMWhat's the conventional behaviour for bringing the dialogs up, on "mouse down" or "mouse up"?
Click here to find out.
Hi JJ,
Unless your link was only for me to click it, the link is of this very thread.
Otherwise, the link responds to the mouse up event.
However, menus respond to the mouse down events.
I am curious to check on your link



jj2007

Quote from: LordAdef on April 14, 2019, 03:06:50 PM
Otherwise, the link responds to the mouse up event.

Yes, that's the whole point ;-)

Check whatever you like: menu file open, the close box in the upper right corner, etc, it's always the mouse up event.

Quote from: LordAdef on April 14, 2019, 03:06:50 PM
However, menus respond to the mouse down events.

Check again. Mine on Win7 and Win10 respond to mouse up.

LordAdef

QuoteCheck again. Mine on Win7 and Win10 respond to mouse up.
Quote
Top menus are mouse down, for me. Win10, but on a laptop.
But it makes sense for dialogs to be mouse up, so one can trace mouse coords to move things around, during the mouse down.
Thanks! I've learned it's never a waste of time to ask stupid questions :dazzled:

LordAdef

By the way, has anyone around here implemented a dialog system? I will soon post mine solution, but am curious to know

jj2007

Sure :P

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
DlgDefine "Please enter your data, tab for next line:", 0, 0, 150, -4, , 12   ; x, y ignored, 150 wide, 4 lines, blank, font size 12
  ; the blank arg uses DlgDefStyle=WS_OVERLAPPED or WS_SYSMENU or DS_CENTER - modify if necessary
  DlgControl dcEdit,   "First name", WS_BORDER or WS_TABSTOP, 1, -2    ; first control gets the focus; this is the 2nd line
  DlgControl dcEdit,   "Family name", WS_BORDER or WS_TABSTOP, 1, -4   ; x, y only, the macro will assign width, height and ID
  DlgControl dcStatic,         "Type your first name:", SS_LEFT, 1, -1, 70.0           ; 70 means 70% - the buttons need space; line 1
  DlgControl dcButton,         "OK", BS_DEFPUSHBUTTON or WS_TABSTOP, 71.0, -1, 12.0, , IDOK            ; x=71%, y, width=14%, height, ID
  DlgControl dcButton,         "Quit", BS_PUSHBUTTON or WS_TABSTOP, 84.0, -1, 16.0, , IDCANCEL
  DlgControl dcStatic,         wCat$("Type your family name: (it's "+wTime$+" now)"), SS_LEFT, 1, -3
; DlgHandler MyHandler                         ; optional - PM me for details
  DlgShow
  .if eax==IDOK                         ; user clicked OK, let's see what was typed into the two edit boxes:
        wMsgBox 0, wCat$(Dlg$(0)+wCrLf$+Dlg$(1)), "Please confirm:", MB_OKCANCEL
  .endif
EndOfCode

LordAdef

Just built it. Nice and clean.
I will post my version as soon as possible.

daydreamer

Quote from: LordAdef on April 14, 2019, 05:02:42 AM
Hey guys!
Because of lack of time, I decided to tackle something easier that is still missing in my game.
..Dialogs..
Games need cool Dialogs, not those boring Windows ones.
Instead of finding out how to customize/learn the Windows way of doing it, I decided to code my own dialogs.

If anyone has any interest, I'll be happy to clean and share the code.
Although mine is already working, I am interest in knowing different solutions for this topic. Please let me know.
For now I'd like to ask: What's the conventional behaviour for bringing the dialogs up, on "mouse down" or "mouse up"?
Cheers Alex
I would be interested,great to see you work on your game again
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

LordAdef

Thanks dayDreamer,


I do it everytime I can, but sometimes it's quite difficult. Either because of the work, or exaustion.


As soon as I have a working demo I share.