Esempio n. 1
0
HWND CreateHighlightView(HWND hwndParent)
{
	HWND hwndPanel;
	HWND hwndGridView;
	HWND hwndTB1;

//	RegisterGridView();

	InitGridView();

	//
	//	Create the base tool panel
	//
	hwndPanel = ToolPanel_Create(hwndParent, HighlightViewCommandHandler);
	//ToolPanel_AddVSpace(hwndPanel, 4);


	ToolPanel_AddGripper(hwndPanel);

	
	//
	//	Create the 1st toolbar (the "Goto" button)
	//
	hwndTB1   = CreateEmptyToolbar(hwndPanel, IDB_BITMAP11, 16, 666, TBSTYLE_LIST);
	SendMessage(hwndTB1, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);

	GetWindowWidth(hwndTB1);
	AddButton(hwndTB1, IDC_HIGHLIGHT_ADD, 0, TBSTYLE_BUTTON, _T("Add"));
	AddButton(hwndTB1, IDC_HIGHLIGHT_EDIT, 3, TBSTYLE_BUTTON, _T("Edit"));
	AddButton(hwndTB1, IDC_HIGHLIGHT_DELETE, 1, TBSTYLE_BUTTON, _T("Delete"));
	AddButton(hwndTB1, -0, 0, TBSTYLE_SEP, 0);
	AddButton(hwndTB1, IDC_HIGHLIGHT_SHOWALL, 2, TBSTYLE_BUTTON|TBSTYLE_CHECK, _T("Show All"));
	AddButton(hwndTB1, IDC_HIGHLIGHT_REPORT, 4, TBSTYLE_BUTTON, _T("Create Report"));
	ResizeToolbar(hwndTB1);
	ToolPanel_AddItem(hwndPanel, hwndTB1, 0);
	ToolPanel_AddNewLine(hwndPanel, 4);

	
	

	//
	//	Create the gridview!!
	//
	hwndGridView = PrepGridView2(hwndPanel, IDC_HIGHLIGHT_GRIDVIEW);
	
	GridView_SetStyle(hwndGridView, -1, GVS_READONLY|GVS_FULLROWSELECT|GVS_VERTGRIDLINES//|GVS_TREELINES
		//|GVS_SHOWFOCUS
		);//,GVS_FULLROWSELECT|GVS_GRIDLINES);

	
	
	//UpdateHighlights(g_hwndHexView, hwndGridView);
	//UpdateHighlights((HWND)-1, hwndGridView);

	ToolPanel_AddItem(hwndPanel, hwndGridView, 0);
	ToolPanel_AddAnchor(hwndPanel, 0, 2);

	ToolPanel_AutoSize(hwndPanel);
	SetWindowHeight(hwndPanel, 200, NULL);

	ShowWindow(hwndPanel, SW_SHOW);
	return hwndPanel;
}
Esempio n. 2
0
HWND CreateSearchBar(HWND hwndParent)
{
	HWND hwndPanel;
	HWND hwndTB1;
	HWND hwndTB2;
	HWND hwndTB3;
	HWND hwndTB4;
	HWND hwndCombo1;
	HWND hwndCombo2;

	int tbheight;

	HIMAGELIST hImgList;
	COMBOBOXEXITEM cbxi = { CBEIF_IMAGE|CBEIF_SELECTEDIMAGE|CBEIF_TEXT };

	//
	//	Create the base tool panel
	//
	hwndPanel = ToolPanel_Create(hwndParent, oof);
	
//ToolPanel_AddGripper(hwndPanel);

	//
	//	Create the 3rd toolbar (search buttons)
	//
	hwndTB3   = CreateEmptyToolbar(hwndPanel, IDB_BITMAP3, 15, 668, TBSTYLE_LIST|TBSTYLE_TRANSPARENT);
	SendMessage(hwndTB3, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS );
	SendMessage(hwndTB3, TB_SETBUTTONSIZE, 0, MAKELPARAM(32, 42));
	//AddButton(hwndTB3, IDM_FILE_OPEN, 8,   TBSTYLE_BUTTON|TBSTYLE_DROPDOWN , TEXT("Ascii"));
	AddButton(hwndTB3, IDM_FILE_NEW, 5,  TBSTYLE_BUTTON, TEXT("Prev"));	
	AddButton(hwndTB3, IDM_FILE_SAVE, 2,   TBSTYLE_BUTTON , TEXT("Next"));// »"));
	ResizeToolbar(hwndTB3);

	ToolPanel_AddItem(hwndPanel, hwndTB3, 0);

	//
	//	Create the search combobox
	//
	hwndCombo2 = CreateChild(0, WS_TABSTOP|WS_CHILD|WS_VISIBLE|CBS_DROPDOWN, TEXT("ComboBoxEx32"), hwndPanel, 6666);
	
	// meh
	hImgList = ImageList_LoadImage(GetModuleHandle(0),
		MAKEINTRESOURCE(IDB_BITMAP7), 16, 10, RGB(255,0,255), IMAGE_BITMAP, LR_CREATEDIBSECTION);
	//SendMessage(hwndCombo2, CBEM_SETIMAGELIST, 0, (LPARAM)hImgList);

	cbxi.iImage = 8;
	cbxi.iSelectedImage = 8;
	cbxi.iItem = 0;
	cbxi.pszText = TEXT("Hello World");
	cbxi.cchTextMax = 10;

	//iSelectedImage
	//SendMessage(hwndCombo2, CBEM_SETITEM, 0, (LPARAM)&cbxi);
	//SendMessage(hwndCombo2, CBEM_INSERTITEM, 0, (LPARAM)&cbxi);



	SetWindowSize(hwndCombo2, 200, 200, NULL);
	ToolPanel_AddItem(hwndPanel, hwndCombo2, 0);

	//
	//	Create the 'type' button
	//
	hwndTB4 = CreateEmptyToolbar(hwndPanel, IDB_BITMAP4, 16, 668, TBSTYLE_LIST);
	SendMessage(hwndTB4, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS );
	AddButton(hwndTB4, IDM_FILE_OPEN, 8,   TBSTYLE_BUTTON|TBSTYLE_DROPDOWN , TEXT("Ascii"));
	tbheight = ResizeToolbar(hwndTB4);
	ToolPanel_AddItem(hwndPanel, hwndTB4, 0);



	//
	//	Create the 1st toolbar (the "Goto" button)
	//
	ToolPanel_AddGripper(hwndPanel);

	hwndTB1   = CreateEmptyToolbar(hwndPanel, IDB_BITMAP3, 15, 666, TBSTYLE_LIST);
	SendMessage(hwndTB1, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS);

	GetWindowWidth(hwndTB1);
	AddButton(hwndTB1, -0, 3, TBSTYLE_BUTTON, TEXT("Goto »"));
	GetWindowWidth(hwndTB1);
	ResizeToolbar(hwndTB1);
	GetWindowWidth(hwndTB1);
	ToolPanel_AddItem(hwndPanel, hwndTB1, 0);

	//
	//	Create the goto-combo box
	//

	//hwndCombo1 = CreateChild(0, WS_CHILD|WS_VISIBLE|CBS_DROPDOWN, "COMBOBOX", hwndPanel);
	hwndCombo1 = CreateChild(0, WS_TABSTOP|WS_CHILD|WS_VISIBLE|CBS_DROPDOWN, TEXT("ComboBoxEx32"), hwndPanel, 0);
	SetWindowSize(hwndCombo1, 100, 200, NULL);
	ToolPanel_AddItem(hwndPanel, hwndCombo1, 0);

	//
	//	Create the 2nd toolbar (bookmark buttons)
	//
	hwndTB2   = CreateEmptyToolbar(hwndPanel, IDB_BITMAP2, 15, 667, TBSTYLE_LIST);
	SendMessage(hwndTB2, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS|TBSTYLE_EX_DRAWDDARROWS);
	//SendMessage(hwndTB1, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
	SendMessage(hwndTB2, TB_SETBUTTONSIZE, 0, MAKELPARAM(32, 32));
	AddButton(hwndTB2, IDM_SEARCH_REPLACE, 7, TBSTYLE_DROPDOWN|TBSTYLE_BUTTON|TBSTYLE_CHECK, 0);//TEXT("Highlight"));
	ResizeToolbar(hwndTB2);
	AddButton(hwndTB2, 0, 1, TBSTYLE_BUTTON, TEXT("Bookmark"));
	

	ToolPanel_AddItem(hwndPanel, hwndTB2, 0);
	ToolPanel_AddNewLine(hwndPanel, 0);

	ToolPanel_AutoSize(hwndPanel);

	ShowWindow(hwndPanel, SW_SHOW);

	return hwndPanel;
}