DAS  3.1.6 - 18/09/2017
REQ.C
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <process.h>
5 #include "mgui.h"
6 #include "DAS_Spatram.h"
7 /*
8  * Shell creation prototypes
9  */
11 
12 
13 void DDMessage(char *str)
14 {
15  char buf[80];
16  MOBJECT sh, lbl;
17 
18  sprintf(buf, "AUTODISTRUZIONE");
19 
20  sh = MCreateShell(buf, SF_MODAL);
21 
22  lbl = MCreateLabel(sh, str, LARGE_FONT);
23  MObjectSetForegroundRGB(lbl, 255, 255, 255);
24  MObjectSetBackgroundRGB(lbl, 255, 0, 0);
25 
27 /*
28  sprintf(buf, "Txed: %s", DXL.buftx);
29  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
30  MLabelSetAlignment(lbl, LEFT_ALIGN);
31 
32  sprintf(buf, "Rxed: %s", DXL.bufrx);
33  lbl = MCreateLabel(sh, buf, DEFAULT_FONT);
34  MLabelSetAlignment(lbl, LEFT_ALIGN);
35 */
36  MShellRealize(sh);
37 }
38 
39 
40 void MDQuitCB(MOBJECT shell, void *od, void *ad)
41 {
42  int c = (int) ad;
43  switch (c)
44  {
45  case 0:
46  {
47  MShellUnrealize(shell);
48  MShellDestroy(shell);
49  break;
50  }
51  case 1:
52  {
53  DMessage(" Te lo avevo detto!!!\nAUTODISTRUZIONE del programma.\n Tra 10 Secondi iniziera' la FORMATTAZIONE del DISCO rigido!");
54  delay(10000);
55  MShellUnrealize(shell);
56  MShellDestroy(shell);
57  MGUITerm();
58  system("Adrenalina.exe");
59  exit(0);
60  break;
61  }
62  }
63 
64 }
65 
66 /*
67  * Shell creation functions
68  */
69 
71 {
72  MOBJECT _dshell000;
73  MOBJECT _drowform000;
74  MOBJECT _dpbutton000;
75  MOBJECT dlbl;
76  _dshell000 = MCreateShell("", 0);
77  MObjectSetForegroundRGB(_dshell000, 96, 133, 149);
78  MObjectSetBackgroundRGB(_dshell000, 96, 133, 149);
79 
80  _drowform000 = MCreateRowForm(_dshell000);
81  MObjectSetBackgroundRGB(_drowform000, 96, 133, 149);
82  MObjectSetResize(_drowform000, True, True);
83 
84  dlbl = MCreateLabel(_drowform000, "Questa e' una versione SHAREWARE del Software LISDAS,\nquindi NON tutte le funzioni sono attivate.\nPer ottenere la versione completa \nprovvedere all'avvio della pratica per un contratto \nd'opera a favore di DanBo.\nPensaci bene prima di premere CANCEL\n Le conseguenze potrebbero essere terribili!!!!", HELV_MEDIUM);
85  MObjectSetForegroundRGB(dlbl, 255, 255, 255);
86  MObjectSetBackgroundRGB(dlbl, 0, 0, 0);
88 
89  _dpbutton000 = MCreatePButton(_drowform000, "OK - Sono d'accordo", HELV_MEDIUM);
90  MObjectSetBackgroundRGB(_dpbutton000, 160, 112, 112);
91  MPButtonSetCallback(_dpbutton000, MDQuitCB, (void *) 0L);
92 
93  _dpbutton000 = MCreatePButton(_drowform000, "Cancel - Non lo faro' mai!!!", HELV_MEDIUM);
94  MObjectSetBackgroundRGB(_dpbutton000, 160, 112, 112);
95  MPButtonSetCallback(_dpbutton000, MDQuitCB, (void *) 1L);
96 
97 
98  MShellRealize(_dshell000);
99  MShellSetWMCloseCallback(_dshell000, MDQuitCB, 0L);
100 
101  return 0;
102 }
void DMessage(char *str)
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT lbl
Definition: DFileMan.c:42
void DDMessage(char *str)
Definition: REQ.C:13
void MShellRealize(MOBJECT obj)
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
void MShellUnrealize(MOBJECT obj)
MOBJECT MDCreate_shell000(void)
Definition: REQ.C:70
#define LARGE_FONT
Definition: Mguidefs.h:895
void MShellDestroy(MOBJECT obj)
MOBJECT MCreatePButton(MOBJECT parent, const char *text, MTFont font)
void MGUITerm(void)
#define CENTER_ALIGN
Definition: Mguidefs.h:917
#define SF_MODAL
Definition: Mguidefs.h:1019
void delay(unsigned long d)
Pauses for a specified number of milliseconds. .
Definition: Dxl.c:1113
MOBJECT MCreateShell(const char *title, int flags)
void MDQuitCB(MOBJECT shell, void *od, void *ad)
callback for closing a generic MGUI shell
Definition: REQ.C:40
Function prototypes.
void MLabelSetAlignment(MOBJECT p, int align)
void MPButtonSetCallback(MOBJECT button, MGUI_CB cb, void *data)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
void MObjectSetFont(MOBJECT obj, MTFont font, int resize)
#define HELV_MEDIUM
Definition: Mguidefs.h:882
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
void MShellSetWMCloseCallback(MOBJECT p, WM_CLOSE_CB cb, void *a_data)
MOBJECT MCreateRowForm(MOBJECT parent)
______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:44:09 for DAS - Rel. 3.1.6 - 18/09/2017.