NP CAD Page | Articles | Russian | Download

Transparent Splash Screen As a Modeless Dialog
(from the book "AutoCAD: Application Development, Tuning and Customization";)
see also realization in C# with subsequent change of window transparency)

We would like the splash screen window automatically disappear e.g. after five seconds period. It would be good if an impatient user could close it by a click in the client area.
Moreover it is interesting for the splash screen to be transparent and we could see the current drawing entities under it. Transparency can be reached by Opacity property of the windows created with Windows Forms.
Create a new ObjectARX project named Book16 with the preferences as in the prevoius project. Add book16 LISP function that would be called as ads_book16 C-function defined in acrxEntryPoint.cpp file (see listing 5.34).

Listing 5.34. The ads_book16 function
// Based on:
// N.Poleshchuk, Chapter 05\Book16\acrxEntryPoint.cpp
// In the book "AutoCAD: Application Development, Tuning and
// Customization"
// (BHV-Petersburg Publishing House, Russia, 2006)
// http://poleshchuk.spb.ru/cad/eng.html
//
// ----- ads_book16 symbol (do not rename)
static int ads_book16(void)
{

splash16();
acedRetVoid () ;
return (RSRSLT) ;
}

splash16 will be a managed code function. Add to the project Splash16.h and Splash16.cpp files (declaration and body of the splash16 function) and insert #include "Splash16.h" statement at the beginning of the acrxEntryPoint.cpp file.
The Splash16.h file besides splash16 declaration will contain Wform16 class definition for a dialog box. Code for the Splash16.h file is given in listing 5.35.

Listing 5.35. The Splash16.h file

// Based on:
// N.Poleshchuk, Chapter 05\Book16\Splash16.h
// In the book "AutoCAD: Application Development, Tuning and
// Customization"
// (BHV-Petersburg Publishing House, Russia, 2006)
// http://poleshchuk.spb.ru/cad/eng.html
//

#pragma once
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#include "StdAfx.h"
using namespace System;
using namespace System::Drawing;
using namespace System::Windows::Forms;

void splash16();

public __gc class Wform16: public Form
{
public:
Wform16();
protected:
void OnTimerTick(Object *sender, System::EventArgs *ea);
void OnClick(Object *sender, System::EventArgs * ea);
};

Besides splash16 function prototype the Splash16.h file contains description of a managed class derived from the standard Form class. There are three member functions in the class: ...

More...


NP CAD Page | Articles | Russian | Download