News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

examples needed

Started by nrdev, May 28, 2009, 10:19:54 PM

Previous topic - Next topic

nrdev

can someone give me examples how to make group box, radio button, and check box? I have difficulties to make this work. I do everything as it should be, but I can't see the resoult in the application.

mitchi

Well, if you use an IDE like WinAsm or RadAsm, you can drop controls visually, no need to write the resource code yourself.
Then, these resource scripts are compiled by your resource compiler and they are linked into your application executable image.
You then access these controls using their Identifier (ID) and using the proper complex API.

It's not easy, it's going to take you a while before you are good with GUI. Be prepared for it.

Have you checked the MASM32 examples...
There's iczelion too, Test Department and many other source codes you can find.

Jimg

upload a small but complete example of a program where it is not working, and someone will happily show you what is wrong.

dedndave

..... unless it is a password generator for cracking

nrdev

here it is: Download program.zip

The GroupBox is not working. :(

PBrennick

I have never used that approach to create dialog boxes because I cannot see what is going on and can't live that way. One thing is obvious to me though. A Group box is used To associate several controls with each other and that is all. You appear to be treating a GroupBox like a Text or Static box. You should create a text box instead. You can then use
WS_TABGRP to associate any of the controls you want to be in the same tab group. Are you trying to show the result there?

Paul
The GeneSys Project is available from:
The Repository or My crappy website

nrdev

I solved this problem all I needed to is to declare Group Box, radio button, and checkbox, before any ither button.

PBrennick

Yeah, glad you got it fixed. The code for what would be in the group was not included so made troubleshooting a bit of a problem. Always make the controls and then make the group. The z-order is very important here. If you need any more help just ask.

As I said, in memory dialogs are not a favorite of mine. You are undoubtedly attempting to do this job without using a resource script (which is an easy way of doing this). I do the same at times but I use CreteWindowsEx to create all the controls. Download my Sudoku project and see how I created over a hundred controls without using scripting OR an in-memory dialog.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

nrdev

how can I make a group of objects that will not affect selecting of the other objects?

Example:
Group Box with 5 radio buttons, and Group Box with 2 radio buttons. When user selects one radio button from the first group, and then selects one of the radio buttons from second Group Box, bot options remain selected.

ToutEnMasm


Perhaps a little sample with two groupbox will help you.
Anyway ,try to give a different parent window (the groupbox) to the buttons and perhaps this will anwer your question.
If it not work,try something else.

Jimg

a group is from one WS_GROUP to the next WS_GROUP.

When you create a window (eg. a button), put WS_GROUP in the dwStyle parameter of the first window (and only the first window) in the group.  Every window you create afterward (more buttons or whatever) is in the same group.  To start a new group, put WS_GROUP on a new window.  It would be nice if there was a StopGroup parameter, but I don't do this enough to know the fine details.

dedndave

QuoteThe code for what would be in the group was not included

it isn't included because THIS PROGRAM YOU GUYS ARE HELPING WITH IS A PASSWORD GENERATOR

nrdev

solved the first element in the group box need to have WS_GROUP, and the all other in the group should have WS_TABSTOP.

And this IS NOT a password generator, and is not one of the crack programs or such.
Wait to see the completed program, I should complete this program in few days.

Jimg

I played with your program (I've never done imdialogs before) and came up with this that works-
    Dialog "Serial Number Creator","MS Sans Serif",10, \                    ; caption,font,pointsize
            WS_OVERLAPPED or WS_SYSMENU or DS_CENTER, \                     ; style
            11, \                                                            ; control count
            50,50,256,256, \                                                ; x y co-ordinates
            1024                                                            ; memory buffer size

    DlgButton   "Generate",WS_TABSTOP,75,225,35,11,IDOK
    DlgButton   "Exit",WS_TABSTOP,115,225,35,11,IDCANCEL
    DlgButton   "About",WS_TABSTOP,155,225,35,11,100
    ;DlgProgress PBS_SMOOTH or WS_BORDER,3,210,247,10,102

    DlgGroup    "Number of combinations",3,5,150,50,201
    DlgRadio  "option 1",WS_GROUP,10,15,50,10,202
    DlgRadio  "option 2",0,       10,25,50,10,203
    DlgRadio  "option 3",0,       10,35,50,10,204
   
    DlgGroup    "Second Group",    3,55,150,50,301
    DlgRadio  "option 1",WS_GROUP,10,65, 50,10,302
    DlgRadio  "option 2",0,       10,75, 50,10,303
    DlgRadio  "option 3",0,       10,85, 50,10,304

For some reason I haven't figured out yet, your progress bar makes it crash, so I commented it out here.

nrdev

thanks I did it in some similar way, but it wont crash.

Can someone tell me how can I create an array of numbers from 0 to 9.