<commit_before>// 12 april 2015
#include "uipriv_windows.h"

struct tab {
	uiParent **pages;
	uintmax_t len;
	uintmax_t cap;
};

static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
	return FALSE;
}

// we have to handle hiding and showing of tab pages ourselves
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
	struct tab *t = (struct tab *) (c->data);
	LRESULT n;

	switch (nm->code) {
	case TCN_SELCHANGING:
		n = SendMessageW(uiControlHWND(c), TCM_GETCURSEL, 0, 0);
		if (n != (LRESULT) (-1))		// if we're changing to a real tab
			ShowWindow(uiParentHWND(t->pages[n]), SW_HIDE);
		*lResult = FALSE;			// and allow the change
		return TRUE;
	case TCN_SELCHANGE:
		n = SendMessageW(uiControlHWND(c), TCM_GETCURSEL, 0, 0);
		if (n != (LRESULT) (-1)) {		// if we're changing to a real tab
			ShowWindow(uiParentHWND(t->pages[n]), SW_SHOW);
			// because we only resize the current child on resize, we'll need to trigger an update here
			uiParentUpdate(t->pages[n]);<commit_msg>More TODOs. The problems I noticed earlier only happen on wine, so...<commit_after>// 12 april 2015
#include "uipriv_windows.h"

// TODO
// - tab change notifications aren't being sent on wine (anymore...? TODO)

struct tab {
	uiParent **pages;
	uintmax_t len;
	uintmax_t cap;
};

static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult)
{
	return FALSE;
}

// we have to handle hiding and showing of tab pages ourselves
static BOOL onWM_NOTIFY(uiControl *c, NMHDR *nm, LRESULT *lResult)
{
	struct tab *t = (struct tab *) (c->data);
	LRESULT n;

	switch (nm->code) {
	case TCN_SELCHANGING:
		n = SendMessageW(uiControlHWND(c), TCM_GETCURSEL, 0, 0);
		if (n != (LRESULT) (-1))		// if we're changing to a real tab
			ShowWindow(uiParentHWND(t->pages[n]), SW_HIDE);
		*lResult = FALSE;			// and allow the change
		return TRUE;
	case TCN_SELCHANGE:
		n = SendMessageW(uiControlHWND(c), TCM_GETCURSEL, 0, 0);
		if (n != (LRESULT) (-1)) {		// if we're changing to a real tab
			ShowWindow(uiParentHWND(t->pages[n]), SW_SHOW);
			// because we only resize the current child on resize, we'll need to trigger an update here
			uiParentUpdate(t->pages[n]);
{'fraction_non_alphanumeric': 0.1310947562097516, 'fraction_numerical': 0.011039558417663294, 'mean_word_length': 4.023094688221709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4388604', 'n_tokens_mistral': 862, 'n_tokens_neox': 797, 'n_words': 257}