Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

MdiTheme

When using this with the Windows10 theme, Tile no longer works.
Nothing happens when this code is run.
Ret_Val = Send_Event("MAIN_TACTIC","TILE",0)

«1

Comments

  • Is this a problem with the SRP Ribbon control?
  • I'm looking into this.
  • No, I am not using the ribbon control. This is changing the theme without the use of the ribbon control.
    This property
    https://wiki.srpcs.com/display/SubclassControl/MdiTheme
  • Thanks Kevin.
  • BTW separate subject, I use your help F1 exclusively now.
  • Thanks for the confirmation. Kevin had already figured it out (obviously). I moved the thread to the SRP Subclass control category from the SRP Utilities category so this will be relevant to anybody else who might experience the same issue.

    Glad to know that F1 to our site is working for you!
  • Ah OK that makes sense.
  • @jimvaughan, this is fixed in 4.1.16. Using the "TILE" event should behave as expected.

    However, if you want smarter tiling, there is a new option I just added, but you have to call a Subclass control method instead of sending the "TILE" event. I added a method to the Subclass control called Tile. You can pass 0 for horizontal and 1 for vertical, just like the "TILE" event, but you can also pass 2.

    Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 2)

    If you pass 2, the subclassed MDICLIENT will evenly distribute the number of rows and columns based on the number of windows. Here's what 7 tiled windows looks like:



    And here's what 6 tiles looks like.



    Hope this helps.
  • Kevin,

    Very cool, Thank you. I must leave right now, but I will look at this tomorrow.
  • Perfect, many thanks.

    This mditheme makes my app look so much better.

    Thank you again.
  • Two things
    (1) I think you have 0 and 1 reversed.
    (2) Unless I am doing something stupid, it seems to work for a while and then stops.
  • I'm doing more testing to see if I can see when it stops working.
  • It's not your code. It's some mdichilds for some reason when they are open, they don't tile correctly even when not using mditheme.

    You definitely have 1 and 0 reversed.
  • On some mdichilds tile can corrupts a radio button. This is all using the send_event method with no mditheme. I'm trying to figure out why this is happening.
  • Some of this I think was caused by having an OLE_SUBCLASS control on one of the mdi_childs, I had moved it to the main form that contained the mdi_frame and forgot to move this one.

    Still testing.
  • Kevin,
    If I do the following when two mdi child forms are open.
    (1) Tile horizontal and it works.
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 1)
    (2) Tile vertical and nothing happens
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 0)
    (3) Move windows around.
    (4) Tile vertical and it works
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 0)
    (5) Tile horizontal and it works
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 1)
    (6) Tile vertical and nothing happens
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 0)

    Also sometimes when tiling vertical only one of the two windows is resized.

    And as I mentioned you have 0 and 1 flipped.
  • Passing 0, in my tests, gets the same results as passing 0 to the TILE event. The documentation for the TILE event refers to 0 as horizontal and 1 as vertical.

    I tried following the above steps, but I cannot recreate this issue in a standard MDI frame situation. Is there any chance that @Window is not the same on each call?

    You definitely want the Subclass control on the main frame, and it should only have to subclass once at during the frame's creation.
  • Good catch. I can't keep up with how many different ways OI does things.
  • I have no idea what is going on here, I am confused.

    https://wiki.srpcs.com/display/Events/TILE
    0 is horizontal.
    So this, will tile horizontal:
    Ret_Val = Send_Event(@Window,"TILE",0)

    Yet I need to do this to make it horizontal
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 1)

    With the Send_Message method, 0 seems to hardly ever do anything and 1 nealy always works but it's horizontal.

    Separate question what is the difference between:
    status = Send_Message(controlID, "MDITILE" flag)
    and
    status = Send_Message(controlID, "TILE" flag)

    I am still trying to narrow down why some mdichilds sometimes don't tile. I am also still trying to understand why tiling sometimes visually corrupts the controls on the forms.
  • Just tried running SRP_ActiveX_Info.exe Why do they all show as expired?

    License
    ------------
    Location: C:\oi32\Waterloo.srplic
    SRPControls.ocx: 4.1.16.1, C:\oi32\SRPControls.ocx

    Controls
    ------------
    SRP Button Control -- Expired 08/29/2021
    SRP DatePicker Control -- Expired 08/29/2021
    SRP DirectConnect Control -- Expired 08/29/2021
    SRP Editor Control -- Expired 08/29/2021
    SRP EditTable Control -- Expired 08/29/2021
    SRP Hyperlink Control -- Expired 08/29/2021
    SRP Launcher Control -- Free
    SRP Panel Control -- Expired 08/29/2021
    SRP Picture Control -- Expired 08/29/2021
    SRP Popup Control -- Expired 08/29/2021
    SRP ReportTable Control -- Expired 08/29/2021
    SRP Ribbon Control -- Expired 08/29/2021
    SRP Schedule Control -- Expired 08/29/2021
    SRP ShortcutBar Control -- Expired 08/29/2021
    SRP Signature Control -- Expired 08/29/2021
    SRP Sketch Control -- Expired 08/29/2021
    SRP Splitter Control -- Expired 08/29/2021
    SRP StatusBar Control -- Expired 08/29/2021
    SRP Subclass Control -- Expired 08/29/2021
    SRP Tab Control -- Expired 08/29/2021
    SRP Tree Control -- Expired 08/29/2021

  • I'm not sure unless you are running an older copy of the SRP ActiveX Info program. It should be v2.0. If you have an older one, try downloading 2.0 from here.
  • This is from 2.0 which I just downloaded.

    License
    ------------
    Location: C:\oi32\Waterloo.srplic
    SRPControls.ocx: 4.1.16.1, C:\oi32\SRPControls.ocx

    Controls
    ------------
    SRP Button Control -- Expired 08/29/2021
    SRP DatePicker Control -- Expired 08/29/2021
    SRP DirectConnect Control -- Expired 08/29/2021
    SRP Editor Control -- Expired 08/29/2021
    SRP EditTable Control -- Expired 08/29/2021
    SRP Hyperlink Control -- Expired 08/29/2021
    SRP Launcher Control -- Free
    SRP Panel Control -- Expired 08/29/2021
    SRP Picture Control -- Expired 08/29/2021
    SRP Popup Control -- Expired 08/29/2021
    SRP ReportTable Control -- Expired 08/29/2021
    SRP Ribbon Control -- Expired 08/29/2021
    SRP Schedule Control -- Expired 08/29/2021
    SRP ShortcutBar Control -- Expired 08/29/2021
    SRP Signature Control -- Expired 08/29/2021
    SRP Sketch Control -- Expired 08/29/2021
    SRP Splitter Control -- Expired 08/29/2021
    SRP StatusBar Control -- Expired 08/29/2021
    SRP Subclass Control -- Expired 08/29/2021
    SRP Tab Control -- Expired 08/29/2021
    SRP Tree Control -- Expired 08/29/2021
  • Just tested using a backup of my code from end of August and tile works correctly. I can see nothing at first glance that I have changed that could cause tile to stop working. However, I did install SRP control 4.1.11 and 4.1.16.1. I was using 4.1.6.6 how do I downgrade to test my current code with this version? Do I just need to copy the ocx? Or do I need to download the install for the older and version and reinstall?
  • Now I think about replacing the OCX will not work, the old code is already using the new OCX. Does installing the control change something else?
  • Regarding the expired licenses, that was my fault. I updated the build year to 2021 but didn't update the month, make the build date December 2021, which exceeded your August 2021 expiration. You can download the latest build here for a corrected build date.

    If you want to downgrade to 4.1.6.6, you can download that here.

    Most of the time, all you have to do is replace the OCX and you are good to go, but to avoid potential issues, it's always good to re-register the OCX. I recommend keeping all your OCXs in a separate location (not in the OI folder) in a subfolder whose name is the OCX version. So you can have a folder for 4.1.6.6 and a folder for 4.1.17.2. Then all you have to do is register the OCX you want to work with. This will allow you to downgrade versions more easily for troubleshooting purposes.

    The only thing the installer does is put SRPControls.ocx and SRPControls64.ocx into a folder of your choice and register them. Nothing in OI is touched.
  • I have no idea why this is doing this but this is what I am seeing.

    If call this:
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 1)
    It tiles two open mdichilds horizontally, shouldn't this be vertical?
    If I call this:
    Ret_Val = Send_Message(@Window:".OLE_SUBCLASS", "OLE.Tile", @Window:".MDICLIENT", 0)
    It does nothing.

    This has the same issue:
    Ret_Val = Send_Event(@Window,"TILE",1)
    It tiles two open mdichilds horizontally, shouldn't this be vertical?
    Ret_Val = Send_Event(@Window,"TILE",0)
    Does nothing.

    If I do not use mdi_theme, then
    Ret_Val = Send_Event(@Window,"TILE",1)
    Tiles two open mdichilds verticaly
    Ret_Val = Send_Event(@Window,"TILE",0)
    Tiles two open mdichilds horizontal


  • This is what the windows look like. One edittable. Two separate horizontal and one vertical scrollbars (these are separate controls and are not part of the edittable. A OLE splitter bar (without mdi_theme, it uses a OI Splitter bar). An area I draw using BitBlt.
  • You were right. I did have them reversed, but in my defense, it's because OI made TILE work the opposite of WM_MDITILE in windows, which is what TILE uses. So, I don't understand why they flipped it in the first place.

    At any rate, you can download the new build here (version 4.1.18.1).

    Now I need to finish eating this humble pie before dinner.
  • Ha, no worries. I thought I was losing it.
Sign In or Register to comment.