##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 EVALUATION    14/Jan/2011  23:28:08 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\DialogCSM.cpp   #
#    Command line    =  D:\pasha\elf\googlecode\MySMSYS\Mss3\DialogCSM.cpp   #
#                       -D NEWSGOLD -D ELKA -D LANG_EN -lcN                  #
#                       D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\ -o D:\pasha\elf\googlecode\MySMSYS\Mss3\Relea #
#                       se_ELKA_EN\Obj\ -s9 --no_unroll --cpu_mode arm       #
#                       --endian little --cpu ARM926EJ-S --stack_align 4     #
#                       --interwork -e --fpu None --eec++ --dlib_config      #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\LIB\dl5tpainl8n.h" -I                #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\INC\" --inline_threshold=2           #
#    List file       =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\DialogCSM.lst                                  #
#    Object file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \Obj\DialogCSM.r79                                   #
#                                                                            #
#                                                                            #
##############################################################################

D:\pasha\elf\googlecode\MySMSYS\Mss3\DialogCSM.cpp
      1          #include "include.h"
      2          #include "SiemensPDU.h"
      3          #include "MyIpcMessage.h"
      4          #include "File.h"
      5          #include "SmsData.h"
      6          #include "CreateMenu.h"
      7          #include "SmsListMenu.h"
      8          #include "MainMenu.h"
      9          #include "TabGUI.h"
     10          #include "DialogCSM.h"
     11          #include "AdrList.h"
     12          #include "NumList.h"
     13          #include "EditGUI.h"
     14          #include "PopupGUI.h"
     15          
     16          DialogCSM::DialogCSM()
     17          {
     18            dlg_csm_desc.csm_desc.onMessage=OnMessage;
     19            dlg_csm_desc.csm_desc.onCreate=OnCreate;
     20            dlg_csm_desc.csm_desc.onClose=OnClose;
     21          #ifdef NEWSGOLD
     22            dlg_csm_desc.csm_desc.zero1=0;
     23            dlg_csm_desc.csm_desc.zero2=0;
     24            dlg_csm_desc.csm_desc.zero3=0;
     25            dlg_csm_desc.csm_desc.zero4=0;
     26          #endif
     27            dlg_csm_desc.csm_desc.datasize=sizeof(DLG_CSM);
     28            dlg_csm_desc.csm_desc.statesize=1;
     29            dlg_csm_desc.csm_desc.states=&minus11;
     30            dlg_csm_desc.csm_name.wsbody=this->csm_name_body;
     31            dlg_csm_desc.csm_name.ws_malloc=NAMECSM_MAGIC1;
     32            dlg_csm_desc.csm_name.ws_mfree=NAMECSM_MAGIC2;
     33            dlg_csm_desc.csm_name.isbody_allocated=0;
     34            dlg_csm_desc.csm_name.maxlen=DLGCSM_NAME_LEN;
     35            //SUBPROC((void *)SMSDATA->CheckAllCHK, SMSDATA);
     36          }
     37          
     38          DialogCSM::~DialogCSM()
     39          {
     40          }
     41          
     42          
     43          int DialogCSM::OnMessage(CSM_RAM *data, GBS_MSG *msg)
     44          {
     45            DLG_CSM *dlg_csm=(DLG_CSM *)data;
     46            if(msg->msg==MSG_GUI_DESTROYED)
     47            {
     48              if((int)msg->data0==dlg_csm->gui_id)
     49                dlg_csm->csm_ram.state=-3;
     50            }
     51            return 1;
     52          }
     53          
     54          void DialogCSM::OnCreate(CSM_RAM *data)
     55          {
     56            int submsg;
     57            DLG_CSM *dlg_csm=(DLG_CSM *)data;
     58            DialogCSM *dlg=dlg_csm->dlg;
     59            dlg_csm->dlg->UpdateNameDlgCSM(dlg_csm, (int)ELFFNAME);
     60            submsg=dlg_csm->dlg->submsg;
     61            switch(submsg)
     62            {
     63            case SMSYS_IPC_MAIN:
     64              {
     65                TabGUI tab;
     66                dlg_csm->gui_id=tab.CreateTabGUI((::DLG_CSM *)dlg_csm);
     67              }
     68              break;
     69            case SMSYS_IPC_NEW_IN_WIN:
     70              {
     71                SDLIST *sdl;
     72                if((sdl=SMSDATA->FindLastNew()))
     73                {
     74          	PopupNewIn *pni=new PopupNewIn;
     75          	dlg_csm->gui_id=pni->CreatePopupNewIn((::DLG_CSM *)dlg_csm, sdl);
     76                }
     77                //else dlg_csm->gui_id=0;
     78              }
     79              break;
     80            case SMSYS_IPC_NEW_IN_ME:
     81              {
     82                SDLIST *sdl;
     83                if((sdl=SMSDATA->FindSDL((int)dlg->ipc_data)))
     84                {
     85          	PopupNewIn *pni=new PopupNewIn;
     86          	dlg_csm->gui_id=pni->CreatePopupNewIn((::DLG_CSM *)dlg_csm, sdl);
     87                }
     88                //else dlg_csm->gui_id=0;
     89              }
     90              break;
     91            case SMSYS_IPC_NEWSMS:
     92              {
     93                SDLIST *sdl=SMSDATA->AllocSDL();
     94                EditGUI *edg=new EditGUI;
     95                dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_REPLY, 0, 1);
     96              }
     97              break;
     98            case SMSYS_IPC_IN_NEW:
     99              {
    100                SmsListMenu *slm=new SmsListMenu;
    101                dlg_csm->gui_id=slm->CreateSmsListMenu(TYPE_IN_N, 0, (::DLG_CSM *)dlg_csm);
    102              }
    103              break;
    104            case SMSYS_IPC_IN_RD:
    105              {
    106                SmsListMenu *slm=new SmsListMenu;
    107                dlg_csm->gui_id=slm->CreateSmsListMenu(TYPE_IN_R, 0, (::DLG_CSM *)dlg_csm);
    108              }
    109              break;
    110            case SMSYS_IPC_OUT:
    111              {
    112                SmsListMenu *slm=new SmsListMenu;
    113                dlg_csm->gui_id=slm->CreateSmsListMenu(TYPE_SENT, 0, (::DLG_CSM *)dlg_csm);
    114              }
    115              break;
    116            case SMSYS_IPC_DRAFT:
    117              {
    118                SmsListMenu *slm=new SmsListMenu;
    119                dlg_csm->gui_id=slm->CreateSmsListMenu(TYPE_DRAFT, 0, (::DLG_CSM *)dlg_csm);
    120              }
    121              break;
    122            case SMSYS_IPC_ALL:
    123              {
    124                SmsListMenu *slm=new SmsListMenu;
    125                dlg_csm->gui_id=slm->CreateSmsListMenu(0, 0, (::DLG_CSM *)dlg_csm);
    126              }
    127              break;
    128            case SMSYS_IPC_IN_ALL:
    129              {
    130                SmsListMenu *slm=new SmsListMenu;
    131                dlg_csm->gui_id=slm->CreateSmsListMenu(TYPE_IN_ALL, 0, (::DLG_CSM *)dlg_csm);
    132              }
    133              break;
    134            case SMSYS_IPC_NEWSMS_NUM:
    135              {
    136                if(dlg->ipc_data)
    137                {
    138          	//SDLIST *sdl=SMSDATA->AllocSDL();
    139          	EditGUI *edg=new EditGUI;
    140          	//strcpy(sdl->number, (char *)dlg->ipc_data);
    141          	//dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_REPLY, 0, 1);
    142          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, (char *)dlg->ipc_data);
    143          	delete dlg->ipc_data;
    144                }
    145                //else dlg_csm->csm_ram.state=-3;
    146              }
    147              break;
    148            case SMSYS_IPC_SEND_UTF8:
    149              {
    150                if(dlg->ipc_data)
    151                {
    152          	SDLIST *sdl=SMSDATA->AllocSDL();
    153          	EditGUI *edg=new EditGUI;
    154          	WSHDR *ws=AllocWS(strlen((char *)dlg->ipc_data));
    155          	sdl->text=ws;
    156          	utf8_2ws(ws, (char *)dlg->ipc_data, strlen((char *)dlg->ipc_data));
    157          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_EDIT, 0, 1);
    158          	delete dlg->ipc_data;
    159                }
    160                //else dlg_csm->csm_ram.state=-3;
    161              }
    162              break;
    163            case SMSYS_IPC_QR_OPMSG:
    164            case SMSYS_IPC_QN_OPMSG:
    165              {
    166                SDLIST *sdl;
    167                if(dlg->ipc_data && (sdl=SMSDATA->FindOpmsgSDL((int)dlg->ipc_data)))
    168                {
    169          	EditGUI *edg=new EditGUI;
    170          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_EDIT, TYPE_IN_ALL, 0);
    171                }
    172                //else dlg_csm->csm_ram.state=-3;
    173              }
    174              break;
    175            case SMSYS_IPC_VIEW_OPMSG:
    176              {
    177                SDLIST *sdl;
    178                if(dlg->ipc_data && (sdl=SMSDATA->FindOpmsgSDL((int)dlg->ipc_data)))
    179                {
    180          	EditGUI *edg=new EditGUI;
    181          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_VIEW, TYPE_IN_ALL, 0);
    182                }
    183                //else dlg_csm->csm_ram.state=-3;
    184              }
    185              break;
    186            case SMSYS_IPC_REPLY_OPMSG:
    187              {
    188                SDLIST *sdl;
    189                if(dlg->ipc_data && (sdl=SMSDATA->FindOpmsgSDL((int)dlg->ipc_data)))
    190                {
    191          	EditGUI *edg=new EditGUI;
    192          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_REPLY, TYPE_IN_ALL, 0);
    193                }
    194                //else dlg_csm->csm_ram.state=-3;
    195              }
    196              break;
    197            case SMSYS_IPC_SEND_WS:
    198              {
    199                if(dlg->ipc_data)
    200                {
    201          	SDLIST *sdl=SMSDATA->AllocSDL();
    202          	EditGUI *edg=new EditGUI;
    203          	WSHDR *ws=AllocWS(wstrlen((WSHDR *)dlg->ipc_data)+2);
    204          	sdl->text=ws;
    205          	wstrcpy(ws, (WSHDR *)dlg->ipc_data);
    206          	dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_EDIT, 0, 1);
    207          	FreeWS((WSHDR *)dlg->ipc_data);
    208                }
    209                //else dlg_csm->csm_ram.state=-3;
    210              }
    211              break;
    212            case SMSYS_IPC_FVIEW:
    213              {
    214                if(dlg->ipc_data)
    215                {
    216          	SDLIST *sdl=SMSDATA->AllocSDL();
    217          	if(SMSDATA->ReadMss((char *)dlg->ipc_data, sdl))
    218          	{
    219          	  EditGUI *edg=new EditGUI;
    220          	  dlg_csm->gui_id=edg->CreateEditGUI((::DLG_CSM *)dlg_csm, sdl, ED_VIEW, 0, 1);
    221          	}
    222          	//else dlg_csm->csm_ram.state=-3;
    223          	delete dlg->ipc_data;
    224                }
    225                //else dlg_csm->csm_ram.state=-3;
    226              }
    227              break;
    228            default:
    229              //dlg_csm->csm_ram.state=-3;
    230              break;
    231            }
    232            dlg->ipc_data=NULL;
    233            if(!dlg_csm->gui_id) dlg_csm->csm_ram.state=-3;
    234          }
    235          
    236          void DialogCSM::OnClose(CSM_RAM *data)
    237          {
    238            DLG_CSM *dlg_csm=(DLG_CSM *)data;
    239            delete dlg_csm->dlg;
    240          }
    241          
    242          
    243          int DialogCSM::CreateDialogCSM(int submsg, void *ipc_data)
    244          {
    245            DLG_CSM dlg_csm;
    246            zeromem(&dlg_csm, sizeof(DLG_CSM));
    247            this->submsg=submsg;
    248            this->ipc_data=ipc_data;
    249            dlg_csm.dlg=this;
    250            if(submsg==SMSYS_IPC_MAIN
    251              ||submsg==SMSYS_IPC_IN_NEW
    252              ||submsg==SMSYS_IPC_IN_RD
    253              ||submsg==SMSYS_IPC_OUT
    254              ||submsg==SMSYS_IPC_DRAFT
    255              ||submsg==SMSYS_IPC_ALL
    256              ||submsg==SMSYS_IPC_IN_ALL
    257              )
    258              SUBPROC((void *)SMSDATA->CheckAllCHK, SMSDATA);
    259            return (CreateCSM(&dlg_csm_desc.csm_desc, &dlg_csm, 0));
    260          }
    261          
    262          void DialogCSM::UpdateNameDlgCSM(DLG_CSM *dlg_csm, int lgp)
    263          {
    264            DLGCSM_DESC *dlg_csm_desc=(DLGCSM_DESC *)dlg_csm->csm_ram.constr;
    265            wsprintf(&dlg_csm_desc->csm_name, PERCENT_T, lgp);
    266          }
    267          

   Maximum stack usage in bytes:

     Function                       CSTACK
     --------                       ------
     DialogCSM::CreateDialogCSM(int, void *)
                                       64
     DialogCSM::DialogCSM()             0
     DialogCSM::OnClose(CSM_RAM *)      4
     DialogCSM::OnCreate(CSM_RAM *)    36
     DialogCSM::OnMessage(CSM_RAM *, GBS_MSG *)
                                        0
     DialogCSM::UpdateNameDlgCSM(DialogCSM::DLG_CSM *, int)
                                        4
     DialogCSM::delete ~DialogCSM(DialogCSM *)
                                        4
     DialogCSM::new DialogCSM()         4
     DialogCSM::~DialogCSM()            0


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     DialogCSM::DialogCSM()          132
     DialogCSM::~DialogCSM()           4
     DialogCSM::OnMessage(CSM_RAM *, GBS_MSG *)
                                      48
     DialogCSM::OnCreate(CSM_RAM *) 1216
     DialogCSM::OnClose(CSM_RAM *)    24
     DialogCSM::CreateDialogCSM(int, void *)
                                     120
     DialogCSM::UpdateNameDlgCSM(DialogCSM::DLG_CSM *, int)
                                      28
     ?<Constant "Mss3CPP">             8
     DialogCSM::delete ~DialogCSM(DialogCSM *)
                                      20
     DialogCSM::new DialogCSM()       28
     ??DataTable2                      4
     ??DataTable3                      4
      Others                         240

 
 1 868 bytes in segment CODE
     8 bytes in segment DATA_C
 
 1 628 bytes of CODE  memory (+ 240 bytes shared)
     8 bytes of CONST memory

Errors: none
Warnings: none
