0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

c++ builder > TeeChart > スクロールした状態を検知したい (成功してない)

Last updated at Posted at 2015-12-28
動作確認
C++ Builder XE4

TeeChartではマウス右クリックをしてドラッグすることで、グラフの表示範囲をずらすことができる。

ユーザがこのずらす処理をしたかどうかをコードで検知したい(処理を分岐するため)。

現在までわかっているのは以下。

  • Chart1->Panning->X0; (とY0, X1, Y1)は最初0となっている
  • マウス右クリックでドラッグすると X0, Y0, X1, Y1 の値が0以外になる
  • この後でマウス左クリックで右下から左上へ選択して表示範囲を初期状態に戻しても、上記の値4つは0に戻らない。

他にbool値を色々チェックしてみたが、該当のものは見つからず。

try1

Zoom解除動作の時に、X0,Y0,X1,Y1の値を0に入れる方法。
もっとスマートな方法がないものか。

Unit1.cpp
void __fastcall TForm1::Button1Click(TObject *Sender)
{

# if 0
	bool zmd = Chart1->Zoomed;
	bool pnAct = Chart1->Panning->Active;
	bool flt = Chart1->Zoom->UpLeftZooms;
# endif

	int xval0 = Chart1->Panning->X0;
	int yval0 = Chart1->Panning->Y0;
	int xval1 = Chart1->Panning->X1;
	int yval1 = Chart1->Panning->Y1;


	int nop = 1;
}

void __fastcall TForm1::Chart1UndoZoom(TObject *Sender)
{
	int nop=1;

	Chart1->Panning->X0 = 0;
	Chart1->Panning->Y0 = 0;
	Chart1->Panning->X1 = 0;
	Chart1->Panning->Y1 = 0;

}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?