Programs written in Hdevelop when exporting, Halcon will help us convert to the language we need, such as C + +. Example: Hdevelop has the following statement to export:
Dev_close_window ()
Halcon exported to the C + + language becomes the following statement:
if (Hdevwindowstack::isopen ())
Close_window (Hdevwindowstack::P op ());
Understanding MFC should not be difficult to understand, the two sentences at the bottom of what to do! Let me explain the following, hehe
First of all look at Hdevwindowstack this class, in fact, this class is very simple, look at the head file:
classLintexport hdevwindowstack{ Public: Static voidPush (ConstHtuple &win_handle); StaticHtuple Pop ();//No window open, return empty tuple StaticHtuple getactive ();//No window open, return-1 Static voidSetActive (ConstHtuple &win_handle);//No window open Static BOOLIsOpen (); Static voidCloseAll ();};
There are only 6 static methods, and the following one by one explains the 6 methods:
static void Push (const htuple &win_handle); As we all know, to be able to operate on a window, you must be aware of the window handle (may be said here too absolute, duilib except), then Halcon adopted the former idea, it maintains the bottom of the window handle, of course, the graphical display of the handle may be more than one, so here the parameters use Htuple, This structure is like a bucket structure and can be loaded with different types of data structures. Htuple is the foundation of Halcon cross-platform. If there is no htuple,halcon, nothing can be done! To get to the point, this method is to send this handle to Halcon,halcon to save the handle, and then you can do anything about the window that this handle refers to, including destroying the window!
Static Htuple Pop (); This method is to destroy the handle and the window that the handle refers to, there is nothing to say, how to destroy, here I can only guess: Halcon bottom maintains a handle queue, each push a handle, in the queue to add a handle, contrary to each pop, destroy the handle point to the window, As the beginning of the two sentences, the first to determine whether the window is open, if opened, call this pop method, destroy the window, in the following will reopen the window!
Static Htuple getactive (); This method is to get an active window handle from Halcon's handle queue for drawing operations such as displaying images: Read_image (), Disp_obj (), and of course, the window handle obtained here
static void SetActive (const htuple &win_handle); As the name implies, the window in which a handle refers is activated, which I do not use in Halcon.
static bool IsOpen (); Determines whether a window is open, the beginning of the article is used, if it is turned on, then the static void CloseAll () is closed, all windows are closed, the underlying handle queue is traversed, and all are closed and destroyed
Added by Xiejl