Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 193 | ||
---|---|---|---|
Line 149... | Line 149... | ||
149 | 149 | ||
150 | // else is the mouse clicking something ? |
150 | // else is the mouse clicking something ? |
151 | else if (message == WM_LBUTTONDOWN) |
151 | else if (message == WM_LBUTTONDOWN) |
152 | { |
152 | { |
153 | // simulate keypress access so that everything is handled in the same consistent way |
153 | // simulate keypress access so that everything is handled in the same consistent way |
- | 154 | memset (&nm, 0, sizeof (nm)); |
|
154 | nm.hdr.hwndFrom = tab_control->hWnd; |
155 | nm.hdr.hwndFrom = tab_control->hWnd; |
155 | nm.hdr.idFrom = GetDlgCtrlID (tab_control->hWnd); |
156 | nm.hdr.idFrom = GetDlgCtrlID (tab_control->hWnd); |
156 | nm.hdr.code = TCN_KEYDOWN; |
157 | nm.hdr.code = TCN_KEYDOWN; |
157 | nm.wVKey = (GetWindowLong (tab_control->hWnd, GWL_STYLE) & TCS_VERTICAL ? VK_LEFT : VK_DOWN); |
158 | nm.wVKey = (GetWindowLong (tab_control->hWnd, GWL_STYLE) & TCS_VERTICAL ? VK_LEFT : VK_DOWN); |
158 | nm.flags = 0; |
159 | nm.flags = 0; |
Line 366... | Line 367... | ||
366 | 367 | ||
367 | // resize pages array based on number of pages |
368 | // resize pages array based on number of pages |
368 | the_control->pages = (tabpage_t *) realloc (the_control->pages, (the_control->page_count + 1) * sizeof (tabpage_t *)); |
369 | the_control->pages = (tabpage_t *) realloc (the_control->pages, (the_control->page_count + 1) * sizeof (tabpage_t *)); |
369 | 370 | ||
370 | // Add a tab for each name in tabnames (list ends with 0) |
371 | // Add a tab for each name in tabnames (list ends with 0) |
- | 372 | memset (&tie, 0, sizeof (tie)); |
|
371 | tie.mask = TCIF_TEXT | TCIF_IMAGE; |
373 | tie.mask = TCIF_TEXT | TCIF_IMAGE; |
372 | tie.iImage = -1; |
374 | tie.iImage = -1; |
373 | tie.pszText = page_name; |
375 | tie.pszText = page_name; |
374 | TabCtrl_InsertItem (the_control->hWnd, the_control->page_count, &tie); |
376 | TabCtrl_InsertItem (the_control->hWnd, the_control->page_count, &tie); |
375 | 377 | ||
Line 393... | Line 395... | ||
393 | NMHDR nmh; |
395 | NMHDR nmh; |
394 | 396 | ||
395 | the_control = (tabcontrol_t *) tab_control; // quick access to tab control |
397 | the_control = (tabcontrol_t *) tab_control; // quick access to tab control |
396 | 398 | ||
397 | TabCtrl_SetCurSel (the_control->hWnd, page_index); |
399 | TabCtrl_SetCurSel (the_control->hWnd, page_index); |
- | 400 | memset (&nmh, 0, sizeof (nmh)); |
|
398 | nmh.hwndFrom = the_control->hWnd; |
401 | nmh.hwndFrom = the_control->hWnd; |
399 | nmh.idFrom = GetDlgCtrlID (the_control->hWnd); |
402 | nmh.idFrom = GetDlgCtrlID (the_control->hWnd); |
400 | nmh.code = TCN_SELCHANGE; |
403 | nmh.code = TCN_SELCHANGE; |
401 | 404 | ||
402 | SendMessage (the_control->hWnd, WM_NOTIFY, (WPARAM) nmh.idFrom, (LPARAM) &nmh); |
405 | SendMessage (the_control->hWnd, WM_NOTIFY, (WPARAM) nmh.idFrom, (LPARAM) &nmh); |