ここでは、外部命令「UxBack」を使って、デスクトップを隠す機能を追加する方法を解説します。
まず、UDIさんのホームページhttp://homepage.mac.com/udi/から、「UxBack」というソフトをダウンロード、解凍してください。「インストール」ボタンを押して、RPGに、UxBackをインストールしてください。
1.1 デスクトップを隠すためのボタンを作る
環境設定カードに、「チェックボックス」形式のボタンを作ります。「チェックボックス」形式の場合、「オートハイライト」の機能をオンにしないと、ボタン自体が機能しないので、気をつけてください。
このボタンに入れるスクリプトは、以下の通りです。「put the screenRect」から「set the loc of」までのスクリプトは、UxBackに搭載されているものです。
on mouseUp
if hilite of me then
put the screenRect into scrRect
put the rect of this card into cardRect
get item 3 of scrRect - ( item 3 of cardRect - item 1 of cardRect )
put trunc( it / 2 ) into H
get item 4 of scrRect - ( item 4 of cardRect - item 2 of cardRect )
put trunc( it / 2 ) into V
set the loc of card window to H ,V
hide menubar
hide titlebar
UxBack "black"
UxBack menuDisable
else
show menubar
show titlebar
UxBack false
end if
end mouseUp
1.2 Now Loading画面カードのスクリプト
Now Loadingという文字が表示されるカード(名前はありません)のカードスクリプト中、「end OpenStack」の直前に、以下のスクリプトを挿入します。
if hilite of cd btn [デスクトップを隠すボタンの番号] of cd "[環境設定カードの名前]" then
put the screenRect into scrRect
put the rect of this card into cardRect
get item 3 of scrRect - ( item 3 of cardRect - item 1 of cardRect )
put trunc( it / 2 ) into H
get item 4 of scrRect - ( item 4 of cardRect - item 2 of cardRect )
put trunc( it / 2 ) into V
set the loc of card window to H ,V
hide titlebar
hide menubar
UxBack "black"
UxBack menuDisable
end if
この項執筆にあたっては、UDI氏に「UxBack」について書く許可をいただきました。本当にありがとうございました。
|
|