forked from ChrisVeigl/BrainBay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathob_doku.cpp
97 lines (74 loc) · 2.06 KB
/
ob_doku.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* -----------------------------------------------------------------------------
BrainBay Version 1.7, GPL 2003-2010, contact: [email protected]
MODULE: OB_DOKU.CPP: contains functions for the Documentation-Object
Author: Chris Veigl
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; See the
GNU General Public License for more details.
-----------------------------------------------------------------------------*/
#include "brainBay.h"
#include "ob_doku.h"
LRESULT CALLBACK DokuDlgHandler( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
DOKUOBJ * st;
st = (DOKUOBJ *) actobject;
if ((st==NULL)||(st->type!=OB_DOKU)) return(FALSE);
switch( message )
{
case WM_INITDIALOG:
SetDlgItemText(hDlg, IDC_DOKU, st->text);
return TRUE;
case WM_CLOSE:
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_DOKU:
GetDlgItemText(hDlg,IDC_DOKU,st->text,sizeof(st->text));
break;
}
return TRUE;
}
return FALSE;
}
DOKUOBJ::DOKUOBJ(int num) : BASE_CL()
{
outports = 0;
inports = 0;
width=60;
height=40;
strcpy(text," --------- Design Documentation --------");
}
void DOKUOBJ::make_dialog(void)
{
display_toolbox(hDlg=CreateDialog(hInst, (LPCTSTR)IDD_DOKUBOX, ghWndStatusbox, (DLGPROC)DokuDlgHandler));
}
void DOKUOBJ::load(HANDLE hFile)
{
unsigned int x;
load_object_basics(this);
load_property("text",P_STRING,text);
for (x=0;x<strlen(text);x++)
{
if (text[x]=='#') text[x]=10;
if (text[x]=='/') text[x]=13;
}
}
void DOKUOBJ::save(HANDLE hFile)
{
unsigned int x;
for (x=0;x<strlen(text);x++)
{
if (text[x]==10) text[x]='#';
if (text[x]==13) text[x]='/';
}
save_object_basics(hFile, this);
save_property(hFile,"text",P_STRING,text);
}
DOKUOBJ::~DOKUOBJ()
{
// free object
}