Ejemplo n.º 1
0
void ListView_GetContextMenuPoint(HWND p_list,LPARAM p_coords,POINT & p_point,int & p_selection) {
	if ((DWORD)p_coords == (DWORD)(-1)) {
		int firstsel = ListView_GetFirstSelection(p_list);
		if (firstsel >= 0) {
			ListView_EnsureVisible(p_list, firstsel, FALSE);
			RECT rect;
			WIN32_OP_D( ListView_GetItemRect(p_list,firstsel,&rect,LVIR_BOUNDS) );
			p_point.x = (rect.left + rect.right) / 2;
			p_point.y = (rect.top + rect.bottom) / 2;
			WIN32_OP_D( ClientToScreen(p_list,&p_point) );
		} else {
			RECT rect;
			WIN32_OP_D(GetClientRect(p_list,&rect));
			p_point.x = (rect.left + rect.right) / 2;
			p_point.y = (rect.top + rect.bottom) / 2;
			WIN32_OP_D(ClientToScreen(p_list,&p_point));
		}
		p_selection = firstsel;
	} else {
		POINT pt = {(short)LOWORD(p_coords),(short)HIWORD(p_coords)};
		p_point = pt;
		POINT client = pt;
		WIN32_OP_D( ScreenToClient(p_list,&client) );
		LVHITTESTINFO info = {};
		info.pt = client;
		p_selection = ListView_HitTest(p_list,&info);
	}
}
Ejemplo n.º 2
0
	void set_item_selection(HWND p_listview,unsigned p_index,bool p_state)
	{
		PFC_ASSERT( ::IsWindow(p_listview) );
		LVITEM item = {};
		item.stateMask = LVIS_SELECTED;
		item.state = p_state ? LVIS_SELECTED : 0;
		WIN32_OP_D( SendMessage(p_listview,LVM_SETITEMSTATE,(WPARAM)p_index,(LPARAM)&item) );
	}
Ejemplo n.º 3
0
bool CDialogResizeHelper::EvalRect(UINT id, CRect & out) const {
	for(t_size walk = 0; walk < m_table.get_size(); ++walk) {
		if (m_table[walk].id == id) {
			CRect client; WIN32_OP_D( m_thisWnd.GetClientRect(client) );
			return _EvalRect(walk, client.Size(), out);
		}
	}
	return false;
}
Ejemplo n.º 4
0
		BOOL OnInitDialog(CWindow, LPARAM) {
			configToUI();
			{
				CRect rc;
				// WIN32_OP_D() - Debug build only retval check and assert
				// For stuff that practically never fails
				WIN32_OP_D( GetClientRect( &rc ) );
				OnSize( 0, rc.Size() );
			}
			
			return FALSE;
		}
Ejemplo n.º 5
0
	void CTableEditHelperV2_ListView::TableEdit_SetItemFocus(t_size item, t_size subItem) {
		WIN32_OP_D( listview_helper::select_single_item( TableEdit_GetParentWnd(), item ) );
	}
Ejemplo n.º 6
0
	t_size CTableEditHelperV2_ListView::TableEdit_GetItemCount() const {
		LRESULT temp;
		WIN32_OP_D( ( temp = ListView_GetItemCount( TableEdit_GetParentWnd() ) ) >= 0 );
		return (t_size) temp;
	}
Ejemplo n.º 7
0
	void CTableEditHelperV2_ListView::TableEdit_SetField(t_size item, t_size subItem, const char * value) {
		WIN32_OP_D( listview_helper::set_item_text( TableEdit_GetParentWnd(), item, subItem, value) );
	}
Ejemplo n.º 8
0
	RECT CTableEditHelperV2_ListView::TableEdit_GetItemRect(t_size item, t_size subItem) const {
		RECT rc;
		WIN32_OP_D( ListView_GetSubItemRect(TableEdit_GetParentWnd(),item,subItem,LVIR_LABEL,&rc) );
		return rc;
	}
Ejemplo n.º 9
0
	void CTableEditHelperV2_ListView::TableEdit_GetColumnOrder(t_size * out, t_size count) const {
		pfc::array_t<int> temp; temp.set_size(count);
		WIN32_OP_D( ListView_GetColumnOrderArray( TableEdit_GetParentWnd(), count, temp.get_ptr() ) );
		for(t_size walk = 0; walk < count; ++walk) out[walk] = temp[walk];
	}