- Timestamp:
- Aug 4, 2006 6:27:19 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua_wince/pjsua_wince.cpp
r641 r648 13 13 static HWND hMainWnd; 14 14 static HWND hwndCB; 15 static HWND hwndGlobalStatus; 16 static HWND hwndURI; 17 static HWND hwndCallStatus; 15 static HWND hwndGlobalStatus, hwndURI, hwndCallStatus; 16 static HWND hwndActionButton, hwndExitButton; 18 17 19 18 static pj_pool_t *g_pool; … … 21 20 static int g_current_acc; 22 21 static int g_current_call = PJSUA_INVALID_ID; 22 static int g_current_action; 23 23 24 24 enum … … 36 36 ID_MENU_ANSWER, 37 37 ID_MENU_DISCONNECT, 38 ID_BTN_ACTION, 38 39 }; 40 41 #define DEFAULT_URI "sip:192.168.0.7" 39 42 40 43 … … 64 67 { 65 68 wchar_t tmp[128]; 69 if (len==-1) len=pj_ansi_strlen(uri); 66 70 pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); 67 71 SetDlgItemText(hMainWnd, ID_GLOBAL_STATUS, tmp); … … 74 78 { 75 79 wchar_t tmp[128]; 80 if (len==-1) len=pj_ansi_strlen(uri); 76 81 pj_ansi_to_unicode(uri, len, tmp, PJ_ARRAY_SIZE(tmp)); 77 82 SetDlgItemText(hMainWnd, ID_URI, tmp); … … 83 88 { 84 89 wchar_t tmp[128]; 90 if (len==-1) len=pj_ansi_strlen(state); 85 91 pj_ansi_to_unicode(state, len, tmp, PJ_ARRAY_SIZE(tmp)); 86 92 SetDlgItemText(hMainWnd, ID_CALL_STATUS, tmp); … … 101 107 case ID_MENU_NONE: 102 108 InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("None")); 109 SetWindowText(hwndActionButton, TEXT("-")); 103 110 break; 104 111 case ID_MENU_CALL: 105 112 InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Call")); 113 SetWindowText(hwndActionButton, TEXT("&Call")); 106 114 break; 107 115 case ID_MENU_ANSWER: 108 116 InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Answer")); 117 SetWindowText(hwndActionButton, TEXT("&Answer")); 109 118 break; 110 119 case ID_MENU_DISCONNECT: 111 120 InsertMenu(hMenu, ID_EXIT, MF_BYCOMMAND, action, TEXT("Hangup")); 121 SetWindowText(hwndActionButton, TEXT("&Hangup")); 112 122 break; 113 123 } 114 124 115 125 EnableMenuItem(hMenu, action, MF_BYCOMMAND | (enable?MF_ENABLED:MF_GRAYED)); 126 DrawMenuBar(hMainWnd); 127 128 g_current_action = action; 116 129 } 117 130 … … 131 144 132 145 g_current_call = PJSUA_INVALID_ID; 133 SetURI( "sip:", 4);146 SetURI(DEFAULT_URI, -1); 134 147 SetAction(ID_MENU_CALL); 135 SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); 148 //SetCallStatus(call_info.state_text.ptr, call_info.state_text.slen); 149 SetCallStatus(call_info.last_status_text.ptr, call_info.last_status_text.slen); 136 150 137 151 } else { … … 259 273 pjsua_media_config_default(&media_cfg); 260 274 pjsua_transport_config_default(&udp_cfg); 275 udp_cfg.port = 50060; 261 276 pjsua_transport_config_default(&rtp_cfg); 277 rtp_cfg.port = 40000; 262 278 263 279 /* Setup media */ … … 388 404 LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); 389 405 hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, 390 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,406 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 200, 391 407 NULL, NULL, hInstance, NULL); 392 408 … … 412 428 { 413 429 X = 10, 430 Y = 40, 414 431 W = 220, 415 432 H = 30, … … 431 448 dwStyle, // Window style 432 449 X, // x-coordinate of the upper-left corner 433 60, // y-coordinate of the upper-left corner450 Y+0, // y-coordinate of the upper-left corner 434 451 W, // Width of the window for the edit 435 452 // control 436 H , // Height of the window for the edit453 H-5, // Height of the window for the edit 437 454 // control 438 455 hWnd, // Window handle to the parent window … … 451 468 dwStyle, // Window style 452 469 X, // x-coordinate of the upper-left corner 453 100, // y-coordinate of the upper-left corner470 Y+H, // y-coordinate of the upper-left corner 454 471 W, // Width of the window for the edit 455 472 // control 456 H , // Height of the window for the edit473 H-5, // Height of the window for the edit 457 474 // control 458 475 hWnd, // Window handle to the parent window … … 461 478 NULL); // Specify NULL for this parameter when 462 479 // you create a control 463 SetURI("sip:", 4, true); 464 SetFocus(hwndURI); 480 481 // Create action Button 482 hwndActionButton = CreateWindow( L"button", L"Action", 483 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 484 X, Y+2*H, 485 60, H-5, hWnd, 486 (HMENU) ID_BTN_ACTION, 487 hInst, NULL ); 488 489 // Create exit button 490 hwndExitButton = CreateWindow( L"button", L"E&xit", 491 WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 492 X+70, Y+2*H, 493 60, H-5, hWnd, 494 (HMENU) ID_EXIT, 495 hInst, NULL ); 496 465 497 466 498 // Create call status edit … … 471 503 dwStyle, // Window style 472 504 X, // x-coordinate of the upper-left corner 473 140, // y-coordinate of the upper-left corner505 Y+3*H, // y-coordinate of the upper-left corner 474 506 W, // Width of the window for the edit 475 507 // control 476 H , // Height of the window for the edit508 H-5, // Height of the window for the edit 477 509 // control 478 510 hWnd, // Window handle to the parent window … … 482 514 // you create a control 483 515 SetCallStatus("Ready", 5); 484 485 516 SetAction(ID_MENU_CALL); 517 SetURI(DEFAULT_URI, -1); 518 SetFocus(hwndURI); 519 486 520 } 487 521 … … 500 534 wmId = LOWORD(wParam); 501 535 wmEvent = HIWORD(wParam); 536 if (wmId == ID_BTN_ACTION) 537 wmId = g_current_action; 502 538 switch (wmId) 503 539 {
Note: See TracChangeset
for help on using the changeset viewer.