Author Topic: Dialog Maker  (Read 821 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9739
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Dialog Maker
« on: January 05, 2022, 04:47:42 PM »
Attached is an app that is a dialog code maker. It addresses basic boilerplate code to get dialogs up and running so they can easily be modified into working applications. It produces a simple resource dialog with two buttons, OK and Close and the dialog has WM_CTLCOLORxxx support for most of the controls that can have their colour set by this technique.

The code builds at 10240 bytes complete with a 766 byte icon, a manifest and a version control block. It is pure API code that uses fully documented API functions. The zip file contains the Dialog Maker binary and an example built with it in a separate zip file, demo.zip. Note that the paths to the BIN and INCLUDE directories are set to my machine and you will need to change them to the paths on your own box.

With the Dialog Maker binary, you set the paths to the locations on your own machine and it should work OK.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9739
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Dialog Maker
« Reply #1 on: January 05, 2022, 09:42:25 PM »
To edit the dialog, download Ketil Olsen's RESED.

http://masm32.com/board/index.php?topic=239.0
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 9739
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Dialog Maker
« Reply #2 on: January 07, 2022, 09:53:46 AM »
Here is an example first produced in DlgMaker and then modified with Ketil Olsen's RESED. For a minor twiddle, the window type is changed to  WS_OVERLAPPEDWINDOW which makes the window sizeable. Then a status bar is added from the left side toolbar. As the window is now sizeable, the code,

      Case %WM_SIZE
        MoveWindow hSbar,0,0,0,0,%TRUE

is added so that the status bar is always located at the bottom of the window.

The menu is code added to the RC script file.

50 MENUEX
BEGIN
  POPUP "&File"
  BEGIN
    MENUITEM "&Exit",102
  END
  POPUP "&Help"
  BEGIN
    MENUITEM "&About",101
  END
END

The menu is activated by the following code.

        hMnu = LoadMenu(hInstance,ByVal 50)
        SetMenu hWnd, hMnu

For very simple code, you get a sizeable working window that is 11264 bytes in size as a base to design a window based application.

When Bob Zale added the DDT capacity to PowerBASIC, he pointed it at folks who had come from a MS-DOS background and many people have been able to write working UI applications using DDT but it needs to be recognised that it was a technique aimed as a bridge for folks who came from the MS-DOS era, not as a replacement for system wide windows code, the Application Programming Interface.

For people who have already developed the UI skills using DDT, this is the next step, using the full Windows API to create their own UI and pick up all of the advantages of power and efficiency.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: