?? maindemo_.cpp
字號:
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Pause ();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton3Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Stop ();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton4Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Play();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton7Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->PlayBackwards();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton5Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->FastReverse2 (10);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SpeedButton6Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->FastForward2 (10);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar1Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Volume = - TrackBar1->Position * 200;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar2Change(TObject *Sender)
//---------------------------------------------------------------------------
{
// The speed rate is a Double value.
// - normal speed = 1
// - half-speed = 0.5
// - 1 1/2 speed = 1.5
// - etc...
ActiveMovie1->Rate = 0.5 + ((TrackBar2->Max - TrackBar2->Position) / 200); // Max - Position to reverse direction
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar3Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->ZoomSize = TrackBar3->Position;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar4Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Balance = (25 - TrackBar4->Position) * 400;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar5Change(TObject *Sender)
//---------------------------------------------------------------------------
{
if (TrackBar5->Tag == 0) {
ActiveMovie1->TimePosition = TrackBar5->Position * ActiveMovie1->TotalTime / TrackBar5->Max;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar6Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->ScrollVert (TrackBar6->Min, TrackBar6->Position, TrackBar6->Max);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TrackBar7Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->ScrollHorz (TrackBar7->Min, TrackBar7->Position, TrackBar7->Max);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox1Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->FullScreenMode = CheckBox1->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox2Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->ShowControls = CheckBox2->Checked;
CheckBox2->Checked = ActiveMovie1->ShowControls; // loopback if ShowControls rejected
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox3Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->DisplayLogo = CheckBox3->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox4Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->AutoStart = CheckBox4->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox5Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->ShowScrollBars = CheckBox5->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::CheckBox6Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->Visible = CheckBox6->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RadioGroup1Click(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->DisplaySize = TDisplaySize (RadioGroup1->ItemIndex);
RadioGroup1->ItemIndex = Integer (ActiveMovie1->DisplaySize); // loopback
}
//---------------------------------------------------------------------------
#if __BORLANDC__ < 0x560 // this function was introduced only starting from BCB6
Extended StrToFloatDef(char *s, Extended Default)
//---------------------------------------------------------------------------
{
Extended Result;
Result = Default;
if (! TextToFloat(s, &Result, fvExtended)) {
Result = Default;
}
return (Result);
}
#endif
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit2Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->SelectionStart = StrToFloatDef (Edit2->Text.c_str(), -1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Edit3Change(TObject *Sender)
//---------------------------------------------------------------------------
{
ActiveMovie1->SelectionEnd = StrToFloatDef (Edit3->Text.c_str(), -1);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SetAnchorsIfNotD3OrBCB3()
//---------------------------------------------------------------------------
{
// the anchors are programmatically set here according to the BCB version
// because these properties did not exist in BCB 3
#if __BORLANDC__ > 0x530 // this function was introduced starting from BCB6
Edit1->Anchors = TAnchors() << akLeft << akRight << akTop;
GroupBox4->Anchors = TAnchors() << akRight << akTop;
RadioGroup1->Anchors = TAnchors() << akRight << akTop;
GroupBox1->Anchors = TAnchors() << akRight << akTop;
BitBtn1->Anchors = TAnchors() << akRight << akTop;
TrackBar2->Anchors = TAnchors() << akRight << akTop << akBottom;
Label2->Anchors = TAnchors() << akRight << akBottom;
Button4->Anchors = TAnchors() << akRight << akBottom;
TrackBar6->Anchors = TAnchors() << akRight << akBottom;
Button5->Anchors = TAnchors() << akRight << akBottom;
TrackBar1->Anchors = TAnchors() << akLeft << akTop << akBottom;
TrackBar4->Anchors = TAnchors() << akLeft << akTop << akBottom;
Label3->Anchors = TAnchors() << akLeft << akBottom;
Label1->Anchors = TAnchors() << akLeft << akBottom;
Button6->Anchors = TAnchors() << akLeft << akBottom;
Label18->Anchors = TAnchors() << akLeft << akBottom;
TrackBar3->Anchors = TAnchors() << akLeft << akRight << akBottom;
Label19->Anchors = TAnchors() << akLeft << akBottom;
TrackBar5->Anchors = TAnchors() << akLeft << akRight << akBottom;
Label14->Anchors = TAnchors() << akRight << akBottom;
Button5->Anchors = TAnchors() << akRight << akBottom;
TrackBar7->Anchors = TAnchors() << akRight << akBottom;
ActiveMovie1->Anchors = TAnchors() << akLeft << akRight << akTop << akBottom;
#endif
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -