Announcement

Collapse
No announcement yet.

Discussion on dialog resizing in source code forum

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

  • Discussion on dialog resizing in source code forum

    hi all

    i've posted simple routines to manage resizing of dialogs in pb 7.0

    source at http://www.powerbasic.com/support/pb...ad.php?t=23434

    regards - carlo

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

  • #2
    Carlo,

    very nice work, love it...

    One more great code piece for PB'er

    Ciao

    ------------------
    Pierre

    [This message has been edited by Pierre Bellisle (edited February 27, 2004).]

    Comment


    • #3
      Very impressive Carlo !!!

      It seemed ashame though that your code could only be used with
      PB 7.0, so I did a conversion of your program by adding 3 more
      routines to the inc file, so it can be used with PB 6.0/6.1 .
      (see: Source Code Forum)

      I converted the CONTROL SET USER, CONTROL GET USER, DIALOG GET USER
      and DIALOG SET USER commands (only in PB 7.0) to custom functions
      which use properties. The properties are accessed using Atoms, so
      they are quite fast.

      Now everybody can benefit from your efforts !


      ------------------
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        Thanks Chris,

        I thought everyone had moved to V7 However your version does not work for me
        on W2K and PB6.11 or 7. The whole dialog goes grey as soon as I resize
        ------------------

        OK - Chris, found problem - pse edit your code to use MAKLNG for Get/SetProp
        Also note that a small memory leak may be created without using RemoveProp when exiting the dialog.

        Code:
        SUB Rz_SetUser(BYVAL hDlg&, BYVAL ControlID&, BYVAL N&, BYVAL UData&)
            IF N&<1 OR N&>4 THEN EXIT SUB
            IF ControlID&=0 THEN
                SetProp hDlg&, BYVAL MAKLNG(App_UserDataAtom&(N&), 0), UData&
            ELSE
                SetProp GetDlgItem(hDlg&, ControlID&), BYVAL MAKLNG(App_UserDataAtom&(N&), 0), UData&
            END IF
        END SUB
        
        FUNCTION Rz_GetUser(BYVAL hDlg&, BYVAL ControlID&, BYVAL N&) AS LONG
            IF N&<1 OR N&>4 THEN
                FUNCTION=0
                EXIT FUNCTION
            END IF
            IF ControlID&=0 THEN
                FUNCTION=GetProp(hDlg&,BYVAL MAKLNG(App_UserDataAtom&(N&), 0))
            ELSE
                FUNCTION=GetProp(GetDlgItem(hDlg&, ControlID&),BYVAL MAKLNG(App_UserDataAtom&(N&), 0))
            END IF
        END FUNCTION


        [This message has been edited by Carlo Pagani (edited July 05, 2002).]

        Comment


        • #5
          Carlo,

          I added the fixes you noted and then I added code to free all
          the properties, when the dialog is destroyed. There shouldn't be
          a memory leak anymore.

          I reposted the fixed program.



          ------------------
          Chris Boss
          Computer Workshop
          Developer of "EZGUI"
          http://cwsof.com
          http://twitter.com/EZGUIProGuy

          Comment


          • #6
            Very Nice!

            I use Lance's custom Resize32 DLL, it's the cat's meow of resize controls!

            Regards,
            Jules

            Comment


            • #7
              Thanks for making the changes Chris.

              Hi Jules,

              Thanks for nice comments.

              Not meant to compete with Lance, just intended to provide a usefull tool to newbies
              starting off with PB to make life a little easier. For me resizing was a big hurdle in moving
              to windows so I thought I'd share these fairly simple routines in exchange for all the good
              stuff I've got out of this forum in the past.

              Regards - Carlo

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


              [This message has been edited by Carlo Pagani (edited July 06, 2002).]

              Comment


              • #8
                Very Nice Carlo,

                How would you modify it to allow you to resize on of the ListViews
                inside the window WITHOUT resizing the window?

                ------------------
                Kind Regards
                Mike

                Comment


                • #9
                  Great Work Carlo and Thanks Chris for the 6.x mods.

                  ------------------
                  Client Writeup for the CPA


                  mailto:[email protected][email protected]</A>
                  Client Writeup for the CPA

                  buffs.proboards2.com

                  Links Page

                  Comment


                  • #10
                    Hi Mike,

                    Are you still having trouble with sizing a control inside a fixedd dialog?
                    Email a sample snippet and I'll fix it for you. jmXpressATlookDOTca

                    Regards,
                    Jules

                    Comment

                    Working...
                    X