Jump to content

VNoticeDialog: Difference between revisions

From EDM2
Created page with "A utility class to display a message. ==Synopsis== ; '''Header:''' : <tt>[vquickr.htm#vNoticeDialog <v/vnotice.h>]</tt> ; '''Class name:''' : vNoticeDialog ; '''Hierarchy:''' :..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:


==Synopsis==
==Synopsis==
 
;Header: <tt><v/vnotice.h></tt>
; '''Header:'''
;Class name: vNoticeDialog
: <tt>[vquickr.htm#vNoticeDialog <v/vnotice.h>]</tt>
;Hierarchy: vModalDialog ->vNoticeDialog
; '''Class name:'''
: vNoticeDialog
; '''Hierarchy:'''
: [vmodald.htm vModalDialog] ->vNoticeDialog


==Description==
==Description==
This simple utility class can be used to display a simple message to the user. The utility displays the message, and then waits for the user to enter to press OK.
This simple utility class can be used to display a simple message to the user. The utility displays the message, and then waits for the user to enter to press OK.


==New Methods==
==New Methods==
 
;vNoticeDialog(vBaseWindow* win)
====vNoticeDialog(vBaseWindow* win)====
;vNoticeDialog(vApp* app):The <tt>vNoticeDialog</tt> constructor requires a pointer to a <tt>vBaseWindow</tt>, which includes all '''''V''''' windows and dialogs, or a pointer to the <tt>vApp</tt> object. You will usually pass the <tt>this</tt> to the constructor.
 
;void Notice(const char* prompt):You provide a <tt>prompt</tt> for the user. If the message contains 'backslashn' newlines, it will be shown on multiple lines.
====vNoticeDialog(vApp* app)====
 
The <tt>vNoticeDialog</tt> constructor requires a pointer to a <tt>vBaseWindow</tt>, which includes all '''''V''''' windows and dialogs, or a pointer to the <tt>vApp</tt> object. You will usually pass the <tt>this</tt> to the constructor.
 
====void Notice(const char* prompt)====
 
You provide a <tt>prompt</tt> for the user. If the message contains 'backslashn' newlines, it will be shown on multiple lines.


===Example===
===Example===
The following is a simple example of using <tt>vNoticeDialog</tt>.
The following is a simple example of using <tt>vNoticeDialog</tt>.


[[Image:notice.gif]]<br /><font size="-2"> </font>
[[Image:v-gui-notice.gif]]


     #include <v/vnotice.h>
     #include <v/vnotice.h>
     ...
     ...
Line 39: Line 25:
     (void)note.Notice("This is a notice.");
     (void)note.Notice("This is a notice.");


[[Category:Tools Articles]]
[[Category:V C++ GUI Framework]]

Latest revision as of 22:28, 9 April 2020

A utility class to display a message.

Synopsis

Header
<v/vnotice.h>
Class name
vNoticeDialog
Hierarchy
vModalDialog ->vNoticeDialog

Description

This simple utility class can be used to display a simple message to the user. The utility displays the message, and then waits for the user to enter to press OK.

New Methods

vNoticeDialog(vBaseWindow* win)
vNoticeDialog(vApp* app)
The vNoticeDialog constructor requires a pointer to a vBaseWindow, which includes all V windows and dialogs, or a pointer to the vApp object. You will usually pass the this to the constructor.
void Notice(const char* prompt)
You provide a prompt for the user. If the message contains 'backslashn' newlines, it will be shown on multiple lines.

Example

The following is a simple example of using vNoticeDialog.

    #include <v/vnotice.h>
    ...
    vNoticeDialog note(this);   // instantiate a notice

    (void)note.Notice("This is a notice.");