Author Topic: Dialogs  (Read 564 times)

LordAdef

  • Member
  • ****
  • Posts: 642
Dialogs
« 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

jj2007

  • Member
  • *****
  • Posts: 9513
  • Assembler is fun ;-)
    • MasmBasic
Re: Dialogs
« Reply #1 on: April 14, 2019, 12:18:06 PM »
What's the conventional behaviour for bringing the dialogs up, on "mouse down" or "mouse up"?
Click here to find out.

LordAdef

  • Member
  • ****
  • Posts: 642
Re: Dialogs
« Reply #2 on: April 14, 2019, 03:06:50 PM »
What'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

  • Member
  • *****
  • Posts: 9513
  • Assembler is fun ;-)
    • MasmBasic
Re: Dialogs
« Reply #3 on: April 14, 2019, 06:39:05 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.

However, menus respond to the mouse down events.

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

LordAdef

  • Member
  • ****
  • Posts: 642
Re: Dialogs
« Reply #4 on: April 15, 2019, 05:29:58 AM »
Quote
Check 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

  • Member
  • ****
  • Posts: 642
Re: Dialogs
« Reply #5 on: April 15, 2019, 07:44:22 AM »
By the way, has anyone around here implemented a dialog system? I will soon post mine solution, but am curious to know

jj2007

  • Member
  • *****
  • Posts: 9513
  • Assembler is fun ;-)
    • MasmBasic
Re: Dialogs
« Reply #6 on: April 15, 2019, 09:56:30 AM »
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

  • Member
  • ****
  • Posts: 642
Re: Dialogs
« Reply #7 on: April 15, 2019, 12:36:44 PM »
Just built it. Nice and clean.
I will post my version as soon as possible.

daydreamer

  • Member
  • ****
  • Posts: 830
  • watch Chebyshev on the backside of the Moon
Re: Dialogs
« Reply #8 on: April 17, 2019, 01:25:49 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
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*

LordAdef

  • Member
  • ****
  • Posts: 642
Re: Dialogs
« Reply #9 on: April 18, 2019, 09:08:20 AM »
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.