PowerShell In GUI Blog

PowerShell GUI Box Just In A Few Clicks

Which Icons Are Shipped With Object Browser?

leave a comment »

Actually, what is the easiest way to display icons? Create a control like ListView? Maybe. Let’s create a handful of windows, just to observe how short the code might be.

First, import both modules, SuiteCore and ObjectBrowser (here and thereafter the PSDevStudioLite modules set is in use).

After that you are able to use the function set shipped with the package. The following simple code creates windows, which in turn demostrate icons.

cls
function createWindows
{
    for($private:i = 0; $private:i -lt $imagesList.Count; $private:i++)
    {
        $tw2 = New-SEToolWindow -Control (([System.Windows.Forms.ListBox]$lb = New-Object System.Windows.Forms.ListBox) | %{$lb;}) `
            -TitleBarText ("aaa" + $private:i) `
            -WindowName ("aaaaa" + $private:i) `
            -Image $imagesList[$imagesList.Keys[$private:i]] `
            -Visible $false -State TabbedDocument;
        Write-Host $private:i $imagesList.Keys[$private:i]
        $se.ToolWindows[("aaaaa" + $private:i)].Visible = $true;
    }
}

createWindows;

In the GUI you might easily see all of them by clicking a triangle, allowing you to make a list of all open documents:

To clean up the document list is also simply, even somewhat simpler that to fill up:

function removeWindows
{
for($private:i = 0; $private:i -lt $imagesList.Count; $private:i++)
{
Remove-SEToolWindow -WindowName ("aaaaa" + $private:i);
}
}

removeWindows;

 

Requirements: PSDevStudioLite.SuiteCore 1.0.0.4 Beta and higher, PSDevStudioLite.ObjetBrowser 1.0.0.4 Beta ang higher.

http://www.box.net/shared/ot56ct7ngl

Note: all above are never be supported by quest, wasn’t and won’t be.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: