Announcement

Collapse
No announcement yet.

masked-edit newbie questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • masked-edit newbie questions

    Hi, I've been a lurker for several months but finally
    freed up enough time to actually start using these compilers.
    Most of the systems I've been dealing with have several data
    input screens then produce reports.

    Now the questions ( there will be more later probably ).
    How do you do a masked-edit field in DDT? Several of the fields
    I deal with have varying decimal points and I need to align them
    on the screen. Is there something I've missed in the help files?

    Thanks for any help.

    Paul Elliott

  • #2
    Also got a question concerning the use of the SysIPAddress32 edit box,
    I'm trying to use it, but don't seem to get anything on screen. has
    anyboby used it? (Didn't find anything in the forums concerning it...)


    ------------------
    Peter.
    mailto[email protected][email protected]</A>
    Regards,
    Peter

    Comment


    • #3
      To create a SysIPAddress32 common control, uncomment %NOIPADDRESS,
      (see other posting about the mis-spelling of this in COMMCTRL.INC)
      include COMMCTRL.INC and initialize with something like:
      Code:
        LOCAL iccex AS INIT_COMMON_CONTROLSEX
        iccex.dwSize = SIZEOF(iccex)
        iccex.dwICC = %ICC_INTERNET_CLASSES
        CALL InitCommonControlsEx(iccex)
      Now, here's the tricky part - in DDT dialog, CONTROL ADD "SysIPAddress32"..
      creates the control, handle is available, but program crasches right after
      WM_INITDIALOG. CreateWindow API gives same result.

      In SDK-style dialog - no problems. Can't understand the difference there.
      After initializing, following works fine in SDK-style dialog:
      Code:
        hIPedit = CreateWindow("SysIPAddress32", "", %WS_CHILD OR %WS_VISIBLE, _
                             20, 4, 180, 22, hwnd, %ID_IPEDIT, hInst, %NULL)
      After that, just use the IPM_ .. messages to handle it, like
      IPM_GETADDRESS to get the IP adress in the control, etc.
      See COMMCTRL.INC, under "SysIPAddress32", where they are listed.


      ------------------

      Comment


      • #4
        samples are better. posted little one to source code forum: http://www.powerbasic.com/support/pb...ad.php?t=23418

        ------------------

        Comment


        • #5
          paul, there are a couple of masked edit controls in the source code forum:

          http://www.powerbasic.com/support/pb...ad.php?t=22947

          http://www.powerbasic.com/support/pb...ad.php?t=23916


          i hope this helps!


          ------------------
          lance
          powerbasic support
          mailto:[email protected][email protected]</a>
          Lance
          mailto:[email protected]

          Comment


          • #6
            Borje,

            Many thanks! My biggest problem was I never noticed the misspelled %NOIPADDRESS
            constant.....



            ------------------
            Peter.
            mailto[email protected][email protected]</A>
            Regards,
            Peter

            Comment


            • #7
              Looking back at code samples posted to these forums, many of us have
              been including the COMMCTRL.INC code for the IP control since day one.
              (since misspelled in the exclude text, it has been included automatically)

              Funny how we have managed to miss that one for so long in our constant
              chase for leaner app's..

              (a quick test on some samples shows a 1024 byte decrease in EXE size
              with correct spelling of %NOIPADDRESS..) (PBnote sample, -512 bytes)
              ------------------




              [This message has been edited by Borje Hagsten (edited April 11, 2001).]

              Comment


              • #8
                originally posted by lance edmonds:
                paul, there are a couple of masked edit controls in the source code forum:

                http://www.powerbasic.com/support/pb...ad.php?t=22947

                http://www.powerbasic.com/support/pb...ad.php?t=23916


                i hope this helps!


                thanks lance. i guess i'll wait for pb to put one in the
                compiler ( or see what the one in the new ezgui looks like ).
                i've been programming for 30 years and for 16 on the pc.
                it just seems a little odd not to have a native way to get
                this functionality in a windows compiler.

                i'll just ignore this for a while and work on getting 2 forms
                on the screen at once to interact with 1 set of buttons &
                function keys.

                paul elliott

                Comment


                • #9
                  Paul, one thing I have learned - in Windows world, everything is odd.
                  If we could find a way to get the sysIP control to work with DDT, all
                  would be very simple. Must be something in DDT engine that causes this.
                  Very strange. Ralph's control is very comprehensive and adjustable, so
                  when you have more tíme, it's well worth investigating. I'm sure it's
                  exactly what you need..


                  ------------------

                  Comment


                  • #10
                    Originally posted by PaulElliott:
                    Thanks Lance. I guess I'll wait for PB to put one in the
                    compiler ( or see what the one in the new EZGUI looks like ).
                    I've been programming for 30 years and for 16 on the PC.
                    It just seems a little odd not to have a native way to get
                    this functionality in a Windows compiler.
                    <snip>
                    Paul Elliott
                    Paul, it's not really odd at all - PowerBASIC does not include any custom controls whatsoever in DDT... DDT encapsulates the dialog engine API's but does not provide new control classes, etc. Other languages either provide a complete set of custom controls that look like standard controls (ie, VB), or they provide them through custom control libraries, like MFC, etc.

                    There are ways to implement such functionality with PowerBASIC: either subclass an existing edit control, or superclass the standard Edit control to create a new custom control class.

                    Either way, you can definitely do it with PowerBASIC - it's just not a one-line-of-code solution.

                    If that solution does not lake your fancy, you could always find/purchase a masked-edit custom control that does exactly what you need. www.bg-software.com used to offer a competitively priced masked edit control, but their website was down last time I checked.

                    ------------------
                    Lance
                    PowerBASIC Support
                    mailto:[email protected][email protected]</A>
                    Lance
                    mailto:[email protected]

                    Comment

                    Working...
                    X