ID:1516650
 
(See the best response by Pirion.)
Problem description: So I've been looking around and found no answers,is there a command to enlarge the mainwindow without covering the taskbar? Similar to the [] on chrome/IE/firefox and such.

Best response
As in maximized? winset(src,"mainwindow","is-maximized=true")
Yeah, i've seen that it covers up the task bar though so it's not what im looking for...
I believe what you're asking for is something like this?

mob
{
proc
{
_windowControls(_action, _window)
{
if(!_action || !_window)
{
return;
}

var _cmd

_cmd = _action=="max" ? "is-maximized=true" : _cmd;
_cmd = _action=="maximize" ? "is-maximized=true" : _cmd;

winset(src, _window, _cmd);
}
}
}


Of course, this is only for maximizing a window, but you can add more later.

Example on use:

_windowControls("maximize","default");
Well based on what you stated, you just want to get the size of the clients screen and adjust the width and the height of it.

This way it extends left and right but it won't go to where the task bar is. (Am I right?)
Yes exactly.
Alright, so you want to get the clients screen resolution first. To do so, I use JavaScript.

In JavaScript, you have the variables "screen.width" and "screen.height" which will give you the clients screen.

Make sure you create variables for the mob as such:

mob/var/screen_width;
mob/var/screen_height;


First, you want to use this JavaScript code and send the message to BYOND Dream Seeker(using client/Topic() and such)

Second, you set the mobs variables retrieved through client/Topic() and basically experiment with the cutoff( IE: Know how far high the task bar comes up)

Lastly, you just use winset() to set the size of the newly cropped size.
The setting is controlled by windows. If windows is set to allow windows to maximize over the taskbar then it will. Trying to "guess" how big the taskbar is won't work. There isn't a trick to get the clients resolution minus the taskbar if the windows can overlap, because they can change how big their task bar is, or where it is located.
To get the values via JavaScript and send them to DM, use something like this.

mob/proc/getResolution()
{
src<<browse({"
<script>
var theURL='?screenW='+screen.width+'&screenH='+screen.height;
window.location=theURL;
</script>
"}
,"window=screen");
src<<browse(null,"window=screen");
}

client/Topic(href,href_list[])
{
if(!href)return
if(href_list["screenW"]){mob.screen_width=href_list["screenW"];}
if(href_list["screenH"]){mob.screen_height=href_list["screenH"];}
}

mob/var/screen_width;
mob/var/screen_height;



Note: the getResolution() will set the variables for the client.

Experiment with winset from there, and is-maximized can not be true, I believe, by doing this method.

best of luck though.
In response to Pirion
Pirion wrote:
The setting is controlled by windows. If windows is set to allow windows to maximize over the taskbar then it will. Trying to "guess" how big the taskbar is won't work. There isn't a trick to get the clients resolution minus the taskbar if the windows can overlap, because they can change how big their task bar is, or where it is located.

my "getResolution()" proc just got the client's resolution.
In response to Ssj4justdale
Ssj4justdale wrote:
my "getResolution()" proc just got the client's resolution.

You, my friend, missed my point entirely. I can give three or four ways to get the resolution.

Please post code that can tell me the following:
# 1 - Which side of the screen is my task bar?
# 2 - How large is it, if I allow windows to overlap it?

In response to Pirion
Pirion wrote:
Ssj4justdale wrote:
my "getResolution()" proc just got the client's resolution.

You, my friend, missed my point entirely. I can give three or four ways to get the resolution.

Please post code that can tell me the following:
# 1 - Which side of the screen is my task bar?
# 2 - How large is it, if I allow windows to overlap it?

My apologies, I guess I may have misinterpreted your post.
I thought you were saying that it's impossible to get the client's resolution as well as the task bar and substract it.

If I find a way to get the resolution minus the taskbar, I'll let you know x.x haha
The only way I know is to use size=9999x9999, and compare vs. the javascript resolution, but I doubt that'll work on a computer that is-maximized will not work on.

For sure let me know, I would love to know how to do it too. :)
Ok ok, so I think i'll settle on using is-maximized to just keep things simple, not exactly what I wanted but hey, its close.
In response to Pirion
Pirion wrote:
The only way I know is to use size=9999x9999, and compare vs. the javascript resolution, but I doubt that'll work on a computer that is-maximized will not work on.

For sure let me know, I would love to know how to do it too. :)

Lovely, I devised a way for this to work :o no overlapping either!

Let me create the snippet for you :D
Well I sort of got stumped. I can calculate partially the positon of the taskbar.
In response to Plemith
Plemith wrote:
Ok ok, so I think i'll settle on using is-maximized to just keep things simple, not exactly what I wanted but hey, its close.

mob
{
var
{
screen_width_available;
screen_height_available;
}

proc
{
getResolution()
{
src<<browse({"
<script>
var theURL='?availaH='+screen.availHeight+'&availaW='+screen.availWidth;
window.location=theURL;
</script>
"}
,"window=screen");
src<<browse(null,"window=screen");
}
}

Login()
{
getResolution();
}
}

client/Topic(href,href_list[])
{
if(!href)return
if(href_list["availaH"]){mob.screen_height_available=text2num(href_list["availaH"]);}
if(href_list["availaW"]){mob.screen_width_available=text2num(href_list["availaW"]);}
winset(src,"default","size=[mob.screen_width_available]x[mob.screen_height_available]");
winset(src,"default","pos=0x0");

}


I believe that is what you want? Give it a test go.

Note: I created this with the window name being "default" so you must alter that or test it by creating a new window called default.
In response to Pirion
Pirion wrote:
The only way I know is to use size=9999x9999, and compare vs. the javascript resolution, but I doubt that'll work on a computer that is-maximized will not work on.

For sure let me know, I would love to know how to do it too. :)

Finished it, and it works perfectly and doesn't get in the way of the task bar at all.

mob
{
var
{
screen_width_available;
screen_height_available;
}

proc
{
getResolution()
{
src<<browse({"
<script>
var theURL='?availaH='+screen.availHeight+'&availaW='+screen.availWidth;
window.location=theURL;
</script>
"}
,"window=screen");
src<<browse(null,"window=screen");
}
}

Login()
{
getResolution();
}
}

client/Topic(href,href_list[])
{
if(!href)return
if(href_list["availaH"]){mob.screen_height_available=text2num(href_list["availaH"]);}
if(href_list["availaW"]){mob.screen_width_available=text2num(href_list["availaW"]);}
winset(src,"default","size=[mob.screen_width_available]x[mob.screen_height_available]");
winset(src,"default","pos=0x0");

}


is the code :)

I wished I could get the task bar position, but maybe another time :o
This makes absolutely no sense. If it makes any amount of sense to you then it is absolutely pointless. Not to sound mean or anything... Ever heard of right clicking your task bar and changing properties? Either way this was a waste of everyone's time.