News:

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

Main Menu

wanna port to GUI program

Started by daydreamer, May 29, 2024, 04:29:29 PM

Previous topic - Next topic

daydreamer

Hi
I have a simple calculation ,enter two numbers and print out results
I wanna port it to GUI ,enter numbers in two edit boxes ,don't know if I need a button to press when number entered or edit control sends message when user press enter ?

I already know how to put up windows control for alternative text output with catstr + sendmessage instead of sever prints in console

So far I have simple basic program
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

NoCforMe

You might not need a button; when you hit <Enter> in a single-line edit control, it's the same as pressing the dialog's "default" button (according to the Micro$oft docs), which I guess should give you a WM_COMMAND message with IDOK as the ID.

Nope, wrong; that's only for multi-line edit controls. <Enter> does nothing in a single-line control.

You'll get a notification (EN_CHANGE) every time an edit control gets typed into, but no way to tell if that was a character typed or <Enter> hit. So a button would be the best solution.

Simplest way to display output is to put a static control in the window and use SetWindowText() to set the text. (Or put a status bar at the bottom of the window.)
Assembly language programming should be fun. That's why I do it.

sinsi

Maybe EN_CHANGE or EN_UPDATE to update the calculation after each key, in conjunction with ES_NUMBER, or a button to trigger the calculation.
Quote from: Edit Control StylesAllows only digits to be entered into the edit control. Note that, even with this set, it is still possible to paste non-digits into the edit control.
To change this style after the control has been created, use SetWindowLong.
To translate text that was entered into the edit control to an integer value, use the GetDlgItemInt function. To set the text of the edit control to the string representation of a specified integer, use the SetDlgItemInt function.

zedd151

A resouce dialog box, a coupla edit controls, anda button oughta do it. Easy peasy.
That's how I would do it for a simple program.  Save the rest of the code for the algos. :smiley:
Im lazy, so Id prolly swipe a dialog box outta the Masm32 examples folder for the job. :biggrin: This way I can devote more time to my growing list of unfinished projects. :undecided:

daydreamer

Thanks sinsi ,nocforme,sudoku
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