Alpha Video Training
Results 1 to 13 of 13

Thread: :A5_window_title

  1. #1
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,583

    Question :A5_window_title

    I’m having trouble with the command:

    :A5.window_title = " my title"
    I'm changing the text " my title" for each form that is opened.

    I have entered this in both the OnInit and OnActivate events. I’ve have also tried just one or the other.

    About 50% of the time, this command works. The other 50% of the time, I get whatever is entered in the Form->Properties-> Window->Caption.

    I’ve entered text in the caption only because when the :A5.window_title does fail, the title ends up as empty brackets.

    The first attachment is what I would like to see.
    The second attachment, the one with [] is what I see about 50% of the time.

    Thanks,

    Ron

  2. #2
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default Re: :A5_window_title

    Hi Ron,

    I do this all the time using the 'OnActivate' event of the form and it works 100% of the time. I use a SDI, maximized forms and no system menus.

    Not sure how you have it set up, but the way I am using it seems to work fine.

    Scott

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

    Default Re: :A5_window_title

    Hi Scott,

    I don't know what I'm doing wrong.

    In the form properties, I try to leave the caption as a blank, but alpha keeps putting text in the caption. I put my code in the OnActivate event, the last item. When my application boots up, I can see my desired windows title and then alpha overrides my title with a title including brackets.

    Like I said, this seems to happen all the time when I first start the application. As I switch to different forms, about 50% of the time, my title is visible. The other 50% of the time, alpha overrides my title with it's version.

    Ron

  4. #4
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: :A5_window_title

    Put the code in the OnInIt instead. Also try this with other forms to rule out form corruption for whatever reason.

  5. #5
    "Certified" Alphaholic Ronald Anusiewicz's Avatar
    Real Name
    Ronald Anusiewicz
    Join Date
    Oct 2000
    Location
    Southampton, MA
    Posts
    1,583

    Default Re: :A5_window_title

    Put the code in the OnInIt instead.
    I tried this and it made the problem worse.
    In my brief testing, My Title only showed once or twice.

  6. #6
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,204

    Default Re: :A5_window_title

    Is the form dialog? normal?

  7. #7
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default Re: :A5_window_title

    Have you compacted the database lately? It's amazing how many weird things are often fixed after the data dictionaries are compacted.

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

    Default Re: :A5_window_title

    It's a normal form.

    I'm aware of the value of "Database Compact", so I make sure that I run it quite frequently.

    OnActivate Event on problematic form:

    Code:
    dim shared vTitle as C
    vTitle = GetDefFltDeptCompanyName()
    
    'Get 'Value' property of 'Blankfield' in Form 'Trip_Log_Menu' .
    DIM SHARED vBlankfield AS c
    vBlankfield = topparent:Blankfield.value
    
    'Get value from selected field from a record in 'menu and
    ' store values in variables whose names start with 'vMenu'.
    dim tbl as p
    tbl = table.open("menu")
    DIM Shared vMenu_Blankfield AS C
    vMenu_Blankfield = tbl.Blankfield
    tbl.close()
    
    sys_send_keys("{F5}")
    :A5.window_title = " " + alltrim(vtitle) + " Airplane Trip Log Main Menu"
    Most of the other forms seem to work properly 90% of the time. Two forms are 50/50.

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Baker
    Join Date
    Jun 2006
    Location
    Near Cherry Hill, NJ
    Posts
    1,296

    Default Re: :A5_window_title

    Ron

    Have you tried this

    Code:
    dim shared vTitle as C
    vTitle = GetDefFltDeptCompanyName()
    :A5.window_title = " " + alltrim(vtitle) + " Airplane Trip Log Main Menu"
    
    'Get 'Value' property of 'Blankfield' in Form 'Trip_Log_Menu' .
    DIM SHARED vBlankfield AS c
    vBlankfield = topparent:Blankfield.value
    
    'Get value from selected field from a record in 'menu and
    ' store values in variables whose names start with 'vMenu'.
    dim tbl as p
    tbl = table.open("menu")
    DIM Shared vMenu_Blankfield AS C
    vMenu_Blankfield = tbl.Blankfield
    tbl.close()
    
    parentform.refresh_layout()
    While I do not use shared variables to get the window title I do use the following at the beginning of the OnActivate event for each form

    Code:
    dim title_text as c
    title_text="This is my form name"
    
    a5.window_title=title_text
    After that comes other code.

    It works every time for me.

    FWIW

    Tom Baker

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

    Smile Re: :A5_window_title

    Hi Tom,

    Going with your suggestion, I placed the following code as the first lines in the OnActivate Event for each form:

    Code:
    dim vTitle as C
    vTitle = GetDefFltDeptCompanyName()
    :A5.window_title = " " + alltrim(vTitle) + " Unique text for that form"
    The very first time the application boots up, I get the following:

    Alpha Five - [Main_Menu]

    After that, all the forms seem to be working just fine including the main menu. Right now in appears that the only mis-fire occurs on the initial boot up.

    I can live with this.

    Thanks,

    Ron

  11. #11
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,956

    Default Re: :A5_window_title

    There is definitely something going on - I can't get it to work right in 2 apps, and works perfectly in another - all V10

    Sent in a bug report with reproduceable app - Selwyn suggested it might be a timing issue, but his suggestion didn't fix it.

    on_xbasic_idle("a5.window_title = \"your title\"")

    in the enclosed app (the password is martin3333), this fires on both the oninit and onactivate event - but click on [edit employees] and then come back - it reverts to the default "Alpha Five"

    Ron: the a5.window_title is not the forms display name

    like "Alpha Five [Master Menu]" has two properties - the title and the caption - but they are not the same thing

    what's odd is I have another app, and it works perfectly - I'm wondering if there could be some setting or global variable that is causing the problem
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

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

    Lightbulb Re: :A5_window_title

    Ron: the a5.window_title is not the forms display name

    like "Alpha Five [Master Menu]" has two properties - the title and the caption - but they are not the same thing
    Hi Martin,

    What I noticed and you need to watch carefully, when a new form loads, the title and caption come up first. It's just a flash as when everything is functioning properly(?), then the a5.window_title overwrites the title and caption.

    So I guess it would be safe to say, when things break, a5.window_title breaks by not refreshing the window(?).

    I did look through the preferences to see if there was some setting, but I did not see anything that would lead me to believe there was. It would be nice if one could disable the title and caption and to just go with the a5.window_title() function. The screen would look cleaner with no flashing of the window title bar.

  13. #13
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,956

    Default Re: :A5_window_title

    In an app done in V7 - then to V8 - and then to V10, here is code that I put in the onactivate event for forms - works perfectly

    Code:
    a5.window_title=alltrim(var->facility)+"-" + word(logger,1,",")+"," + left(alltrim(word(logger,2,",")),1)+" ["+this.window_title+"]"
    ok - got it figured out: if I put this or similar code in all forms' onactivate event, works ok and is consistent, but if there is even one form I go to where I don't use this, when I go back to the 'master menu' it reverts to the default

    this is new behavior in V10, but who cares, I know what to do now
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

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
  •