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)
Nothing happens when this code is run.
Ret_Val = Send_Event("MAIN_TACTIC","TILE",0)
Comments
This property
https://wiki.srpcs.com/display/SubclassControl/MdiTheme
Glad to know that F1 to our site is working for you!
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.
Very cool, Thank you. I must leave right now, but I will look at this tomorrow.
This mditheme makes my app look so much better.
Thank you again.
(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.
You definitely have 1 and 0 reversed.
Still testing.
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.
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.
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.
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
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
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.
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.
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.