Make_Window_Visible(0) – Hide & UnHide a Window

Product Compare Forums Multi-Edit User Created Macros Make_Window_Visible(0) – Hide & UnHide a Window

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2675
    shrike
    Participant

    I’m using ME 9.10.4 – WINXP Pro Media Centre Edition

    :shock: Yet again another Window problem!!
    See Full Code below – What Happen’s is I Load a file do some error
    checking and HIDE the Opened file’s Window
    – Make_Window_Visible(0); // — Hide the meeting Window —
    BUT I CAN’T GET IT BACK (VISIBLE) AGAIN!!! :( :( :(

    #include win32.sh is included so I give Up!!!

    From the ME Main Menu I "View" and Select "Windows", The Pane (PAIN) Comes up and shows
    the loaded File! Selecting it and Rt Clicking on it Brings up a sub menu – I Click on "UnHide" and
    Wella – all is Visible!!!

    Just what I want with CMAC without the Pane (PAIN)!!!

    PS: Evolve "Winop /T=" doesn’t Hellp either – No UnHide Info!!!

    [code:1f0ru8dc]macro_File RFTest

    /*******************************************************************************
    Multi-Edit Macro – 23-03-2010 20:19

    Function: `Racing Form – Testing ONLY
    Entry : `RFTest
    Exit : `exit`

    *******************************************************************************/
    #ifdef VER_1000
    #include MeLib.sh
    #else
    #ifdef VER_910
    #include MeLib.sh
    #else
    #include MewLib32.sh
    #endif
    #endif

    #include stddlgs.sh // file where msgdlg macro prototype is defined
    #include win32.sh
    #include dialog.sh
    #include Messages.sh
    #include ListCtrl.sh
    #include SPrintF.sh
    #include mew.sh
    #include DBTools.sh
    #include search.sh
    // #include window.sh

    #define EListBox1 2001
    #define ECombo1 2001
    #define EButton1 2002

    macro RFTest
    { TOF;
    int TRFcw = Cur_Window; // "All TRF xx-xx-xxx.txt" Window
    int MRHcw = 0;
    Str MDat = ""; // 1st Line with Meeting Date in It

    // LOAD THE FILE in sPth+sFnm
    str sFnm[64], sPth[128];
    sPth = "C:\\Davids Bin\\Racing Daily\\"; // In current directory
    sFnm = "TRF Meetings.txt";

    If ( File_Exists( sPth + sFnm ) ) // If the file exists, then Load It
    { // Return_Str = sPth + sFnm;
    RM("LDFiles /NSW=1/NWS=1/CW=1/FN=" + sPth + sFnm ); // load it
    if ( Error_Level != 0 )
    { RM("MEError");
    MsgDlg("ERROR L115 – " + sPth + sFnm + " – COULD NOT LOAD FILE!", "ERROR!", "", 0);
    Set_Global_Str("gRF_Result", "ERROR!");
    }
    Else
    { MRHcw = Cur_Window; // Meeting’s OR Race’s Window
    Make_Window_Visible(0); // — Hide the meeting Window —
    Set_Global_Str("gRF_Result", "OK!"); // — Works Fine !!! —
    }
    }
    Else
    { MsgDlg("ERROR – L217\n" + sPth + sFnm + " FILE NOT FOUND", "ERROR!", "", 0);
    Set_Global_Str("gRF_Result", "ERROR!");
    }

    // MsgDlg("Meetings File Should Be Hidden", "HIDE Window", "", 0);
    Switch_Window( MRHcw ); // Win32.sh is Included see Make_Window #defines
    // Make_Window_Visible(sw_normal); // Visible Values of sw_xxxxxxx – sort of Works
    Make_Window_Visible(sw_ShowMaximized); // Even tried Usw_unhide – NO IT DIDN’T WORK!!!
    RefResh = 1; // BUT NONE OF THE FOLLOWING BRINGS THE EDITING WINDOW
    Update_Window; // BACK CLEARLY!! IE; It Becomes sort of Visible, SAY
    // ReDraw; // about 30% Visable and you CAN’T Do anything withIt!!!
    // New_Screen; // same applies with or without another edit window
    // Update_Window; // open.
    // MsgDlg("Meetings File Should Be NOW VISIBLE", "SHOW Window", "", 0);

    } // RFtest
    [/code:1f0ru8dc]

    #8832
    Clay Martin
    Keymaster

    I believe what is happening is that when you hide the window, you also switch away from it. Try something like this

    after the window is open
    int mywin=Cur_Window;
    ….
    Hide the window
    Make_Window_Visible(0);

    Switch_Window(mywin);
    set your refresh=1 then do your
    Make_Window_Visible(1);
    then do a Redraw

    Another thought is right after the switch, with some debug code, examine the value of Window_Attr just to see what it is.

    Hope this helps,
    Clay

    #8831
    shrike
    Participant

    Hi Clay,
    The code in fact does eactly what you suggessted, after the LDFile
    and checking the if (Error_Level ! = 0)….Else
    { MRHcw = Cur_Window; // Meeting’s OR Race’s Window
    Make_Window_Visible(0); // — Hide the meeting Window —
    Set_Global_Str("gRF_Result", "OK!"); // — Works Fine !!! —
    }

    then…
    Switch_Window( MRHcw ); // Win32.sh is Included see Make_Window #defines
    // Make_Window_Visible(sw_normal); // Visible Values of sw_xxxxxxx – sort of Works
    Make_Window_Visible(sw_ShowMaximized); // Even tried Usw_unhide – NO IT DIDN’T WORK!!!
    RefResh = 1; // BUT NONE OF THE FOLLOWING BRINGS THE EDITING WINDOW
    Update_Window; // BACK CLEARLY!! IE; It Becomes sort of Visible, SAY
    // ReDraw; // about 30% Visable and you CAN’T Do anything withIt!!!
    // New_Screen; // same applies with or without another edit window
    // Update_Window; // open.
    // MsgDlg("Meetings File Should Be NOW VISIBLE", "SHOW Window", "", 0);

    The REDRAW was commented out as it didn’t work!! Well when I Say it didn’t work
    THE WINDOW ONLY SHOW’S A PORTION OF THE FRAME ON THE RIGHT SIDE AND
    A PORTION OF THE TOP FRAME!!! THIS OCCURRS WHETHER I HAVE ANOTHER FILE
    OPEN OR JUST THE FILE LOADED BY ITSELF!!!

    I’LL FOLLOWUP ON THE WINDOW’S ATTR AND SEE WHAT HAPPENS

    THANK’S

    #8834
    shrike
    Participant

    Clay,

    Results of further testing is same as before.

    Tried getting "Window_Attr" and ALLWAYS GET A "1537" RESULT.
    also tried "Switch_Win_ID( TcwID );" AND then Window_Attr.
    RETURNED "1537" also!!!

    I’m Guessing at this stage that "Make_Window_Visible(1);" is NOT
    working properly!!! The 1st Digit (1) according to CMAC User Guide
    suggest the window is Hidden.

    Anyway will pass this on to SUPPORT and see what they come up
    with.

    Chow For Now

    #8839
    shrike
    Participant

    Hi All,

    Support Has fixed the problemfor me amd Many thanks for their Help

    The Solution is as follows:
    When you want to UnHide the Window use the

    "Switch_Window(1)" OR "Switch_Window(3)"
    THEN…….

    //*************** Here are the important changes
    Window_Attr &= 0xFFFF ^ ( _wa_BrHidden | _wa_Hidden );
    Switch_Window( TRFcw );
    Switch_Window( MRHcw );
    //*****************************************

    hAPPY dAYS :roll: :roll: :roll: ARE HERE AGAIN!!!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.