2011-12-19 1 views
2

これは私が何をしたいの例です:自体を操作する制御領域内のすべての表示を行います。ContentSizeがManipulateのコンテンツに合わないときにスクロールバーを表示しない方法は?

Manipulate[ 

p = [email protected] 
    Plot[Sin[x],{x, -y, y},ImageSize->300,Background-> White, ImagePadding -> 20]; 
    {}, 

Grid[{ 
    {Control[{{y, [email protected]/2, "y"}, -Pi, Pi, Appearance -> "Labeled"}]}, 
    {[email protected]} 
    }], 

ControlPlacement -> Left, 
Alignment -> Center, 
ImageMargins -> 1, 
FrameMargins -> 1, 
ContentSize -> {0} 
] 

問題はMが自動的にスクロールバーが追加されていることである:

enter image description here

ヘルプは疑問がある

If ContentSize specifies a content area that does not completely fit 
the contents, then unless specified otherwise with AppearanceElements, 
functions like Manipulate display a resize area, as well as scrollbars 
when necessary. 

を言い、このscrolを削除するにはAppearanceElementsを使用する方法lbar?

(何かを説明するときに、Mのヘルプが短くて短くないことがあります)。

上記には、unless specified otherwise with AppearanceElementsと と表示されていますが、これは何を意味するのかわかりませんでした。 「otherwise」とは何ですか? の意味ですか?

最も近いのは、上記にAppearanceElements -> ""を追加することです。だから、新しい バージョンは今

Manipulate[ 
p = [email protected] 
    Plot[Sin[x], {x, -y, y}, ImageSize -> 300, Background -> White, 
    ImagePadding -> 20]; 
{}, 
Grid[{ 
    {Control[{{y, [email protected]/2, "y"}, -Pi, Pi, Appearance -> "Labeled"}]}, 
    {[email protected]} 
    }], 

ControlPlacement -> Left, 
Alignment -> Center, 
ImageMargins -> 1, 
FrameMargins -> 1, 
ContentSize -> {0}, 
AppearanceElements -> "" (*added this *) 
] 

enter image description here

なるが、大きさは、それがより緊密にする必要があり、まだ 右に非常に正確でないことに気づくと私はまた、「+」使用されたものを失いましたそこにいる。私はそれを保つ必要があります。

だから、私はちょうど「+」の要素名が何であるかを見つけることです必要なものだと思うので、私は正しいAppearanceElements -> "correctNameHere" を使用することができますし、私はこの が正しいことを行うということ期待しています。 (私は "Close"を試みたが、それはしなかった、私も '+'を失った)

私はちょうどその '+'要素名が見つかりませんでした。誰も知っている?ここで

は、これに関するより多くの情報を見つけるための場所です:

http://reference.wolfram.com/mathematica/ref/Manipulator.html

http://reference.wolfram.com/mathematica/ref/ContentSize.html

だから、質問は次のとおりです。完全に上記の を示すスクロールバーの影響を除去する方法が、同じで右上に「+」を入れてください。

おかげで以下の回答に

アップデート2人の

おかげで、ここでの結果のスクリーンショットです。

Manipulate[ 
p = [email protected] 
    Plot[Sin[x], {x, -y, y}, ImageSize -> 300, Background -> White, 
    ImagePadding -> 20]; 
{}, Grid[{{Control[{{y, [email protected]/2, "y"}, -Pi, Pi, 
     Appearance -> "Labeled"}]}, {[email protected]}}], 
AppearanceElements -> "BookmarksButton", ControlPlacement -> Left, 
Alignment -> Center, ImageMargins -> 1, FrameMargins -> 1, 
ContentSize -> {0}, Alignment -> Center] 

enter image description here

私はそれで満足しています。上部の角にある小さな白い線は、これの副作用である と思われます。私はそれを生きなければならないと思う。

+0

あなたは 'Manipulate'のコントロールウィンドウ内のプロットを表示しないことを選択した理由がある:私は知らない他人があるかもしれないけれども有効なオプションは、次のとおり? – abcd

+0

@yoda、はい、非常に良い理由。たとえば、オブジェクト自体のすぐ隣にコントロールを配置できるようになり、UIを使いやすくしました。簡単な例を考えてみましょう:プロット。オプションをいくつか変更できるようにしたい場合。さて、Manipulateのデザインでは、コントロールはすべて片側になり、プロットは反対側に移動します。グループ内でオブジェクトとその制御変数を「一緒に」配置できるようにする方がはるかに優れています。コントロール領域にオブジェクトそのものを置くことができれば、私はそれを行うことができます。これは、より複雑なUIではより重要になります。 – Nasser

+0

1.あなたがやっていることは、AppearanceElementsオプションで破損しているようです。 AppearanceElements-> Noneは、通常、あなたが望むものと、コンテンツエリアにコンテンツを持つおもちゃの例を提供します。 2.これは、あなたが* Manipulateを使用する必要がある別のケースですか?したがって、DynamicModuleを使用するのではなく、提出するように拷問する必要がありますか? 3. "+"要素は "ManipulateMenu"と呼ばれます。 –

答えて

2
Manipulate[ 
p = [email protected] 
    Plot[Sin[x], {x, -y, y}, ImageSize -> 300, Background -> White, 
    ImagePadding -> 20]; 
{}, Grid[{{Control[{{y, [email protected]/2, "y"}, -Pi, Pi, 
     Appearance -> "Labeled"}]}, {[email protected]}}] 
, AppearanceElements -> "ManipulateMenu", ControlPlacement -> Left, 
Alignment -> Center, ImageMargins -> 1, FrameMargins -> 0, 
ContentSize -> {0} ] 

設定FrameMargins->0は(とにかくMac上の)白い線を取り除くのが、まだそこに枠線を残します。 Frame->Falseはこれを変更しません。 Manipulateは何があってもコンテンツ領域を描きたいと思うようです。 AppearanceElementsオプションが不完全に/不十分に文書化されているようです。

{"ContentResizeArea", "HideControlsButton", "ManipulateMenu", "SnapshotButton", 
"ResetButton", "UpdateButton", "BookmarksButton", All, None} 
+0

上記のControlPlacement - > LeftをControlPlacement - > Centerに置き換えました.Windowsでは、以前と同じように白線のトレースも表示されなくなりました。だから私はCenterを使うと思うし、今はすべてうまくいくはずだ。ありがとう – Nasser

2

AppearanceElements -> "BookmarksButton"あなたが探しているものです。ドキュメント(ref/Manipulate)でManipulateのための他AppearanceElements{"HideControlsButton", "SnapshotButton", "ResetButton", "UpdateButton", All}

Manipulateにオプションが白枠を取り除くようPaneled->Falseを追加しています。 PanelManipulateを包むことによって、あなたはあなたが必要なもののように見える何かを得る:

Manipulate[ p = [email protected][Sin[x], {x, -y, y}, ImageSize -> 300, 
Background -> White, ImagePadding -> 20]; {}, 
Grid[{{Control[{{y, [email protected]/2, "y"}, -Pi, Pi, 
    Appearance -> "Labeled"}]}, {[email protected]}}], 
AppearanceElements -> "BookmarksButton", ControlPlacement -> Left, 
Alignment -> Center, ImageMargins -> 1, FrameMargins -> 0, 
ContentSize -> {0}, Paneled->False ]//Panel 
関連する問題