⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cbdemo1.cpp

📁 让喇叭发声的控件
💻 CPP
字号:
#include <vcl\vcl.h>
#pragma hdrstop

// Andy Preston - Apollo Developments - Swindon U.K. - andy@apollod.freeserve.co.uk

// Please note: I do not use C++ Builder, I hope there's no mistakes in this.
// But if there are it will take a while to fix them.

#include "CBDemo1.h"
#pragma resource "*.dfm"

#include "bleeper.hpp"
#include "bleepint.hpp"
#include "gwbleep.hpp"

// You must create bleepint.hpp yourself:
// Create a dummy project, include bleepint.pas in the project and compile it
// you only need to do this once when you first use bleepint (unless you delete bleepint.hpp)

TDemoFrm *DemoFrm;

__fastcall TDemoFrm::TDemoFrm(TComponent* Owner) : TForm(Owner) {
}

// If your demo program uses exotic 3rd Party controlls the loads of people won't be able to run it - KEEP IT SIMPLE

// Watch out! If it's not in a 32-bit console app (i.e. most of the time) Bleepint routines call Application.ProcessMessages,
// so you might have to disable timer, buttons etc. whilst it's working

void __fastcall TDemoFrm::OKBtnClick(TObject *Sender) {
     Bleep (bOK);
}

void __fastcall TDemoFrm::IntBtnClick(TObject *Sender) {
     Bleep (bInterrupt);
}

void __fastcall TDemoFrm::ErrorBtnClick(TObject *Sender) {
     Bleep (bError);
}

void __fastcall TDemoFrm::SlideBtnClick(TObject *Sender) {
     Word i;
     for (i=100; i<150; i++) DoBleep (i*10, 10);
     for (i=150; i>100; i--) DoBleep (i*10, 10);
}


void __fastcall TDemoFrm::BoatBtnClick(TObject *Sender) {
  // 'Ei Ukhnem', More popularly known as 'The Volga Boat Song'
  // This world famous song dates back to the days when teams of men pulled boats up The
  // Volga. At each pull of the rope, the team would sing "Ei Ukhnem" (one more sigh).
  // The words sing the praise of the great "Mother of Rivers", the wide deep Volga
  PlayBleep ("L2D4<B4E<BC#8D4<B4E<BC#DGF#GEL4D<BEE<B1");
  PlayBleep ("O3L2D4<B4E<BC#8D4<B4E<BC#DGF#GEL4D<BEE<B1");
  PlayBleep ("O5L2D4<B4E<BC#8D4<B4E<BC#DGF#GEL4D<BEE<B1");
}

void __fastcall TDemoFrm::PainBtnClick(TObject *Sender) {
     if (PainBtn->Tag==0) {
        PainBtn->Caption="Relief";
        PainBtn->Tag=1;
        DoBleep (1000, -1);
     }
     else {
       PainBtn->Caption="Pain";
       PainBtn->Tag=0;
       ShutUp();
     }
}

void __fastcall TDemoFrm::CloseBtnClick(TObject *Sender) {
     Close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -