Alpha Video Training
Results 1 to 17 of 17

Thread: Text (and/or variable) on toolbar with Xdialog

  1. #1
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default Text (and/or variable) on toolbar with Xdialog

    A while back Selwyn had a thread about making your own status bar with the toolbar genie.

    I want to do something similar but not knowing xdialog can't figure out how to do it. Thought it might be simple for you Xdialog guys. My database deals with people and I wanted a toolbar at the top that had the person's ID and name.

    0000000001 - Tom Mills

    If I tell the genie:

    {text=1000,2:vcID}

    I get a bar the proper length and height and can plug in a variable of the person's ID. But I can't figure out how to get 2 variables (name in other variable) or the "-" as text.

    Ideally I'd like the font size to be big enough to take up both lines of the toolbar. (Can you do that?)

    Any ideas?

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Don't display vcID, build a single varible that has what you want to display:

    vcID = "0000000001"
    vcName = "Tom Mills"
    vcToolbarText = vcID + " - " + vcName

    ui_dlg_box("",

    -Lenny

  3. #3
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Okay, I don't think I can do what I really wanted unless someone knows a trick.

    What I wanted was a form with my own toolbar at the top (which I have) assigned by the form properties.

    Then underneath that (docked essentially) another toolbar that simply displays the Name and ID in fairly large text.

    I can get that toolbar also by itself. (Using the toolbar genie it just needed:

    {font=ComicSans MS,15}{text=1000,2:vcBarTxt}

    The problem is I can't find away to implement that second toolbar. Is there a way to start a second toolbar after the one assigned by the form properties?

  4. #4
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Tom

    What you want is actually fairly easy. You can have more than one toolbar open at a time. If you open 2, the become stacked, which sound like what you want.

    I assume the text for the toolbar will be supplied froma variable. You first need to create the variable and probably set its scope to global and give it a value. Next, create a new blank toolbar. On the toolbar add a free-form xdialog. Click the design xdialog button and place the code you have in the xdialog body. Now preview the toolbar. Is that what you need?

    Jerry

  5. #5
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    I have created both tool bars successfully. The first one (with real buttons) I open with the form as part of the form properties.

    My problem is how do I open the second (already created) toolbar? Form properties only allows you one tool bar, and I see nothing in Action Scripting to allow me to open a toolbar upon form init.

    I suspect there is some xbasic code. I'll look there as soon as I get a chance.

    (But I have to get up in 5 hours to attend 2 days of Spring Training!!)

  6. #6
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Tom

    This xbasic will open a named toolbar

    a5_toolbar_open("ToolbarName")

    and this will close a named toolbar

    a5_close_system_toolbars("ToolbarName")

    This code can be run from a form event, a button, a script, wherever.

    Jerry

  7. #7
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    I used Jack's xbasic to open both my toolbars instead of using the form properties.

    In a perfect world the form looks like this: The system menu on top, the toolbar with buttons next, and then the toolbar displaying the ID and Name variable. (which is showing for text purposes on the form in the middle-right)

  8. #8
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    But what happens is that except for the fact that the button toolbar always opens before the yellow toolbar (corresponding to the way I opened them in xbasic), the toolbars and menus seem to place themselves randomly when I open the form.

    In this shot the system menu is now lowest, and the variable no longer shows up on the toolbar. You can see it momentarily before it repositions into this spot, and it still shows up on the main form.

  9. #9
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Oops. Guess that was Jerry not Jack. In this shot the system menu decided to "go right".

  10. #10
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Now, when I tell the toolbar to go to the bottom (where I don't want it!!) everything stays in it's place everytime.

  11. #11
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Tom

    I would put the main toolbar in form properties so it will load first. On the other toolbar, check if its properties in design is set to allow docking only on top. That might help.

    Jerry

  12. #12
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Jerry I did have it docked to the top, and have tried about everything. Right now, it I have one toolbar starting via form properties, one OnInit.

    They seem to always stay in the right position that way, but the darn system menu is off to the right instead of at the top.

    If you (or anyone else) wants a hack at this, I've attached the database. To duplicate the problem, run the form called "Search", click on one of the names and hit "Okay".

  13. #13
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Tom

    Your problem is the result of the sequence in which objects load. The OnInit event runs before the form loads, so the toolbar loaded there is loaded first. Then the one in properties is loaded.

    The solution is fairly simple. Load the "Selector" toolbar in the form properties. Then move this code to the OnActivate event so it fires after the form loads

    a5_toolbar_open("ID Info")

    You may want to unload the toolbar when the form closes, so put this on the OnDeactivate event to close the ID toolbar

    a5_close_system_toolbars("ID Info")

    This seems to work reliably

    Jerry

  14. #14
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Outstanding. Thanks for your help. Never really understood the difference between OnInit and OnActivate. Thanks.

  15. #15
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    In the end this did not work either. Worked on the first form but once I extended it to several forms, it started failing again.

    I even simplified it by starting the toolbars before I loaded the forms, and took all references to toolbars out of the forms properties/events.

    But still the toolbars started screwing up. They seem unstable to me when you have more than one.

  16. #16
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,173

    Default RE: Text (and/or variable) on toolbar with Xdialog

    Tom

    I think the problem with multiple forms is the same as you were seeing with the one form when the sequence was wrong. After the first form is open, the special toolbar is loaded. Now when you open another, that toolbar takes precedence and you are right back to the first condition.

    One option might be to close the toolbar before you open a form, perhaps on every form OnInit so it is gone before the form loads and then reloading in on every OnActivate. I tried that and is doesn't work well, even with adding the close command on the OnDeactivate events. The toolbars load in the wrong sequence when you switch forms.

    Another option would be to include the ID "toolbar" information right on the form using a text object with a border to simulate a toolbar. It would be very easy to control the text and would eliminate the toolbar conflicts.

    A third option would be to include the text information right on the other custom toolbar. Is doesn't have the band effect, but would be very reliable.

    A fourth option would be to dock the ID toolbar on the bottom of the screen. At least the info would be there and the order of load would have no effect.

    Jerry

  17. #17
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default RE: Text (and/or variable) on toolbar with Xdialog

    What I did last night on a version not posted here was to run inline xbasic to launch the two toolbars prior to loading the first form.

    No other scripts, forms, code, has anything to do with toolbars. They should simply stay where they are at. But switching forms still makes them go "crazy for cocopuffs".

    And you're right, putting it at the bottom seems to be fine. I may run this one by the Alpha folks. I just don't think it's right.

Similar Threads

  1. Rich Text Toolbar
    By Denis gagnon in forum Alpha Five Version 5
    Replies: 1
    Last Post: 04-21-2004, 05:52 AM
  2. Setting a Text Object's Text to a Variable
    By Jarrett Nahon in forum Alpha Five Version 5
    Replies: 3
    Last Post: 11-12-2003, 12:18 PM
  3. LOST TEXT TOOLBAR
    By Jennifer Fuerst in forum Alpha Five Version 5
    Replies: 2
    Last Post: 08-20-2003, 04:20 AM
  4. Toolbar structure, Xdialog, Xbasic ??
    By Jim Chapman in forum Alpha Five Version 5
    Replies: 3
    Last Post: 07-16-2003, 09:55 PM
  5. Text toolbar position
    By Floyd Gerstenfeld in forum Alpha Five Version 5
    Replies: 7
    Last Post: 07-07-2003, 07:05 PM

Bookmarks

Posting Permissions

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