Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: A few more questions..

  1. #1

    A few more questions..

    Ok, with some help I have started to make my menu up.. Just a simple window with buttons.

    The button when click should open up a new window.. or repaint the old with new info. I'm thinking close window and open new.

    Ok, here is what I like to know.. If I click the button, I want it to open this window for more selections. So far there are 4 choice on the main window, which will lead to sub choices. These will be up or down and the results sent serial (I'm not there yet).

    Also, is there a trace command?
    And can I put the result on the debug window.. Like when it ends it will say what my variables had .. Like mag = "yes"

    I use to do this when I would test my functions and if they had what I expected.

    Maybe a little bit of light here will help.

    My job is repair and reverse engineering things that are basically non-repairable. In this case it deals with a Medical Specific monitors that is controlled via serial communication. I have decode all codes and can send via a program called RealTerm. I have a list of 15 main codes dealing with vertical adj, Horz adj, Pin Cushion etc.

    I want to make this portable as you know and easy..

    I'm basically stuck right now at when I click my box, how do I make it do it..
    I want to see it in basic 1st before I make the next menu or control the serial.

    I have looked at sample and have mod the ones to what I need. I have used Petr #include to perform the buttons (Thanks Petr).
    I can put the so so program here if you like.. Just I have lines that are so so..

    Wayne

  2. #2

    Re: A few more questions..

    I have looked at Lionhearts008 code.. It has helped and the light is going from a lowly lit to a better to see you my dear brightness..

    I'm still digging at it..

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: A few more questions..

    Wayne,

    if you post your code, even if basic or incomplete, we can help more. I will be happy to review it and rewrite some part of it if you like.
    Creating different windows is of course possible but it would be more code expensive because you have to write all callbacks. So at first it would be better to just create one window and handle data end events in controls. Consider you can have TAB controls, tree controls, listview, splitter bars, and even viewports. All thise controls let you manage different areas.

    Some thinBasic UI examples are still using old GetMessage way to handle events. We are changing all those examples to callbacks usage so be sure to go into that direction.

    When debugging UI script it is important to place breakpoints on the lines your need to check variables otherwise events can come at hundred per seconds and it would be impossible to debug. thinBasic debugger automatically shows all available variables in the function you are.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Re: A few more questions..

    Here it is, Sort of.. Eros

    There be 4 pop-ups with buttons to do various things, poss left right, up down to reflect adjustment to the monitor.

    The pin-cushion routine will have 2 choice with adj.

    And the serial routine.. Adj code is from 00 to 255. The functions selections will be 00 to 15 with 1 for save and one for reset. Those two are there and not assign as of yet.. I will do that 1st to see if I can talk to the monitor under test.

    Wayne
    Attached Files Attached Files

  5. #5
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: A few more questions..

    I had a look an perhaps this layout might make it easier to maintain.


    update : add these to my version(main window) to make sure that all the windows are killed when the main window is closed

    [code=thinbasic]
    CASE %WM_DESTROY
    DIALOG END hVertDlg
    DIALOG END hHorzDlg
    DIALOG END hPINCDlg
    DIALOG END hVidADlg
    DIALOG END hSaveDlg
    DIALOG END hReseDlg[/code]
    Attached Files Attached Files
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  6. #6

    Re: A few more questions..

    TY Michael, I did insert the info at end (I hope that's where it goes)

    Can any one tell me the equivalent to

    gosub, goto

    As far as I can tell, thinBasic program follows from top to bottom.. by the calls I think,
    I like making my code into blocks and either a goto or gosub (sorry old stuff).

    The Save and the Reset functions do not need a windowpopup.. they just need to send a code to the RS232 port.. in dec it is 64 and 65.. I would need to look up off my list.

    Also the current month and date will be changed to selecting COM port 1 to 4. The rest is all fixed, 9600, 8, n, 1 and the other as a response window of the decimal value selected from the up/dn boxes or arrow keys.

    Here is what I will be doing..

    Lets say Vertical is selected, the popup will have a Size and Center choice,
    Click Size and by pressing either arrows up or dn or a box up or down to increase or decrease size (value).

    The code has to go at as decimal example : 04 (decimal Value)
    Each time the button is hit or up or down press it will change value.
    decimal value is from 000 to 255 and displays warning at low and upper end.

    I know there is an echo back, to confirm the action did.. I wait for that.

    Once you are satisfied by the screen display , they can tap SAVE to store the last info into the monitors eeprom and select the next option.
    I have yet to figure on how to alter the factory settings or read what is stored in the eeprom..
    There is no docs on this monitor and all info was obtain by random inputs from a term program.

    I might put in a fake screen save which is a bunch of codes going to the RS232 with no save. And a wake which is only 4 codes. I figure to have that as to observe the min contrast and brightness when in screen save.

    Wow.. I have work, but somehow I think its a repetitive code routine.

    Wayne



  7. #7
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: A few more questions..

    Wayne there is no GOTO keyword but GOSUB can be replaced with Function or Sub as little subroutines

    rather then writing GOSUB mysubroutine you would just put mysubroutine() and program execution would return to the next line.

    SUB mysubroutine()

    ' your code here

    END SUB
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  8. #8

    Re: A few more questions..

    I thought I let ya know on the progress..

    I know when I exit the program it reports the correct Comport for the RS232.
    Michael, I have added the data and hope it is in the right place. Much easier for me to read.

    Eros, I am using breaks, it helps me a great deal to where the program fails.. I can then look at my mistakes easier!

    I am up'ing the program for review.. I just need to get the sub windows to have a purpose and get the rs232 to talk. Windows 1st, I will work on this at home.. This fun and challenging.

    Wayne
    Attached Files Attached Files

  9. #9

    Re: A few more questions..

    Ok, how can I show my data on the screen in real time.. I have located on the bottom of the main screen a variable called commdata (dword).
    It pops in as default value and when I click my up or down button it does not update on the screen but the commdata does.


  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: A few more questions..

    Hi,

    if you need to update text on some control in dialog, you can use something like:

    CONTROL SET TEXT hDlg, %myLabelWithState, FORMAT$(commdata )


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 1 of 2 12 LastLast

Similar Threads

  1. DT questions
    By Dave in forum DT (Date module)
    Replies: 9
    Last Post: 16-04-2008, 09:48

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •