Get a Jumpstart with our Sample Apps
Results 1 to 20 of 20

Thread: Control Panel & Code Editor Helper: CP_Info()

  1. #1
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Control Panel & Code Editor Helper: CP_Info()

    cp_info.jpg
    CP_Info_11-24-2016.txt

    This is a modification of a utility by Chris Hawkes I found posted here
    There were several modifications already added and then I made a few of my own; most noticeably the buttons and roll up feature.
    I also added sets to the table list and appropriate editors and actions for the different elements.

    The function can be added to the Control_Panel_Addins folder so you have menu options from both the control panel and code editor - I included the text for the files at the end.

    I find I use it all the time - hope you enjoy it too.

    Download the txt file and import into the code tab of the control panel.

    Happy Thanksgiving!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    I made some improvements and bug fixes. It now includes a count for the tables and sets and fields.

    cP_Info-12-02-2016.txt
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  3. #3
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,422

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Robin, thank you so much. This is just the tool I was looking for. The only change I made was to make the Tables list a little wider. Seems some of my tables have longer names. Great job and thanks for sharing.
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    That's a great compliment coming from you!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  5. #5
    "Certified" Alphaholic DaveM's Avatar
    Real Name
    David Mason
    Join Date
    Jul 2000
    Location
    Hudson, FL
    Posts
    5,818

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Thanks to all involved. Works nice
    Dave Mason
    dave@aldaweb.com

    Skype is dave.mason46

  6. #6
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    cP_Info-12-27-2016.txt

    Fixed a typo in the button event that opens/activates the code editor
    Last edited by MoGrace; 12-27-2016 at 01:57 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  7. #7
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Added a line to the Table Info section to show when the selected file was last updated (had to fix an error if a set was clicked on)

    cP_Info_01-08-2017.txt

    Happy New Year
    Last edited by MoGrace; 01-08-2017 at 02:20 PM.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  8. #8
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,422

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Robin, again I'd like to thank you for sharing this tool. I use it every day.

    I do have a request. While I could make the change in my copy, I note that you are continuing development on your side.

    For me, it would be nice if the third column that contains the fields definitions where a multi select list and I could copy selected field definitions as a group to the clipboard. I do a lot of table manipulation using xbasic and I would find the ability to copy and paste a selected group of field definitions very handy.


    Thanks
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  9. #9
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Hi Ron,
    If you already know how to select multiple records in a list and copy to the clipboard - please share! And I will be happy to update the function. I guess that is why this was an ongoing project initially as others kept coming up with other things they wished the control panel did but doesn't. At least that is what got me thinking about it.
    Last edited by MoGrace; 01-15-2017 at 04:39 PM. Reason: spelling - what else?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  10. #10
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,422

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Hi Robin,

    I made some minor changes and tried to document what I did.
    The line numbers may be off slightly.
    While making my changes I did notice other credits:

    'Borrowed from ChrisHawkes & Peter.Greulich

    Chris and Peter, thank you!



    Code:
    line 64		
    '//Dlg Body Expanded
    dlg_body = <<%dlg%
    {removecomments}
    'use current font for line and character spacing
    {units=F}
    'sets the default vertical spacing between controls.
    {ysize=.3}
    
    changed [.25 to [.35 for longer file names
    Line 109	{font=Arial,10,n}{stretch=height}[.35,30vTable^#vTM!tc_*];
    
    changed line 129 from
    [.50,5idxdef^#idxdef];
    to [.50,5idxdef^#idxdef];;
    
    changed text=50
    Line 133  {text=42,3vTinfo1};
    
    changed line 159 from
    [.50,30vField^#vFM!fc_*];
    to [%M%.45,30vField^#vFM!fc_*];
    
    inserted after 156 
    <%T=Copy FIELD DEFINITIONS to lipboard;B=T;I=$$edit.clipboard.edit%!c_Fcopy>;
    
    
    added C_Fcopy after B_Fcopy
    
    ELSE IF a_dlg_button = "B_Fcopy" THEN
    	IF .not. fldflag THEN
    		END'
    	END IF
    	vField = format_data(vField,"C")
    	clipboard.Set_Data(EXTRACT_STRING(vField,"",","))
    ELSE IF a_dlg_button = "C_Fcopy" THEN
    	IF .not. fldflag THEN
    		END'
    	END IF
    	clipboard.Set_Data(vField)
    END IF
    
    %code%
    Attached Files Attached Files
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  11. #11
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Now we can add you to the credits! I don't see what the difference is in the section for Line 129 - is it the additional ' ; ' - what does that do?
    I do see that you made vField a multi select text box on line 159, I am curious to see how it works!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  12. #12
    "Certified" Alphaholic
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,422

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Robin,

    'sets the default vertical spacing between controls.
    {ysize=.3}

    One ; is 1/3 a row spacing, two ;; is 2/3 a row spacing and three ;;; would be the same as {lf};

    Gives one a little more control on how the xDialog looks.
    Alpha Anywhere v3.5
    Version 12.3, Build 2999
    MySql56 & DBF's

    Alpha 4, 5, Anywhere

    Ron Anusiewicz

  13. #13
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    I always thought that was just something arbitrary some people did in their scripts - hah! what do I know? not as much as I think...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  14. #14
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    128

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    I've used a rather old version of this function for years. it was one that someone, I don't know who at this point, turned into a Library and provided instructions on how to use as a addin.

    This newer version looked quite nice I don't know how many times I double clicked on a field of table name expecting it to appear in the code editor. The version I was using didn't do that, this one does.

    I've done some (actually a lot of work) on making Modeless Dialog boxes into MDI windows. MDI windows are what the standard form or browse use, they can be minimized and float behind other windows. I figured this function would be more usable as a MDI window, so I converted it to one.

    I've changed the name to CP_info2() to reflect the significant change in the way it works. At the first of the function are comments that explain how to make this Function into AEX library and use it as a AddIn accessed from the MenuBar in the Code editor just like the version I was previously using.

    The attachment also containts a Script DOC_Dialog_to_MDI this is the documentation I prepared some time ago on how to convert a existing Modeless Dialog into a MDI window, in case anyone is interested.

    cp_info2.txt
    Last edited by pboomwork; 01-20-2017 at 03:23 PM.

  15. #15
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Hi Paul,
    Can you explain the advantage of a MDI window to me vs a modeless Xdialog that stays open & can roll up so that it remains available AND visible? As I understand it, a MDI window becomes hidden when it is deactivated. But of course I may be wrong. BTW, I also included instructions on how to make this function appear in the right click menu on the Control Panel as an Addin.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  16. #16
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    added an option to the subfunction to add restrictions when opening the default browse for a table
    Code:
    FUNCTION vw_defbrws as C (tname as C,vars as P)
    'DESCRIPTION: use to call a default browse with a set size and placement on 1st record    
        DIM brws as P
        WITH vars
            IF .not. is_object(brwsname) THEN
                brws = a5_open_default_Browse(tname)    
                'added a default restriction
                brws.restrict_enter = .t.
                brws.width = 800
                brws.height = 500        
                brws.window_position("left","top")
                'needed to clear the new record line 'ghost'
                brws.refresh_layout()
            ELSE
                brws = obj(brwsname)    
                brws.activate()        
            END IF        
                        
            brws.fetch_first()
    
            vw_defbrws = tname
    
        END WITH
    Thanks to Stan!
    Last edited by MoGrace; 09-25-2017 at 02:36 PM. Reason: TO THANK STAN
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  17. #17
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Quote Originally Posted by MoGrace View Post
    Hi Paul,
    Can you explain the advantage of a MDI window to me vs a modeless Xdialog that stays open & can roll up so that it remains available AND visible? As I understand it, a MDI window becomes hidden when it is deactivated. But of course I may be wrong. BTW, I also included instructions on how to make this function appear in the right click menu on the Control Panel as an Addin.
    Where did you share the latest version

  18. #18
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    128

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Your standard Alpha5 form or browse is a MDI window. Dialogs converted to MDI windows appear in all the A5 window list so they are not completely hidden. But they don't consume desktop space like a rolled up window. It's a personal preference thing 6 of one half dozen of the other. And sorry I missed/overlooked others instructions on adding this as a add in.

  19. #19
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    Latest version:

    cP_Info_20170926.txt

    Anybody know how to delete old attachments?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  20. #20
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,164

    Default Re: Control Panel & Code Editor Helper: CP_Info()

    @ Paul
    I got excited when I saw the video on Dock Panels using a MDI window and thought it would be great for displaying a Home form with a menu panel. But I never got very far on how to actually build one. So I am using a docked modeless dialog on a regular form that stays open as 'wallpaper', and can hide the toolbar menu whenever more space is needed. If a form is a MDI window, then you ought to be able to attach a dock panel to a form...?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Code tab in the control panel disappeared
    By jdoyle in forum Alpha Five Version 8
    Replies: 3
    Last Post: 03-01-2007, 11:09 PM
  2. Control Panel - Code tab - Sort
    By dik_coleman in forum Archived Wishlist
    Replies: 1
    Last Post: 12-27-2005, 09:24 AM
  3. control panel - no code tab
    By Floyd Gerstenfeld in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-21-2003, 12:33 PM
  4. Code Tab from Control Panel
    By Trixie dela Cena in forum Alpha Five Version 5
    Replies: 2
    Last Post: 02-03-2003, 01:31 PM
  5. Missing Code Tab in Control Panel
    By Dave Whittle in forum Alpha Five Version 5
    Replies: 2
    Last Post: 10-18-2002, 02:57 PM

Posting Permissions

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