void LogMessagesViewer::appendMessages()
{
    wxCriticalSectionLocker lock( _messagesCS );

    if ( _messages.empty() ) { return; }

    BeginBatch();

    int row = GetNumberRows();
    AppendRows( _messages.size() );

    do
    {
        appendMessage( _messages.front(), row );
        _messages.pop();
        ++row;
    }
    while ( !_messages.empty() );

    AutoSizeColumns();

    EndBatch();

    MakeCellVisible( GetNumberRows()-1, 0 );
}
Esempio n. 2
0
//------------------------------------------------------------------------------
//
// 	Function Name:	CMLListCtrl::Insert()
//
//	Parameters:		pMLElement - pointer to element to be added to the list control
//					iIndex - index at which to insert the element
//
// 	Return Value:	TRUE if successful
//
// 	Description:	This function is called to insert an element at the specified
//					index
//
//------------------------------------------------------------------------------
BOOL CMLListCtrl::Insert(CMLListCtrlElement* pMLElement, int iIndex, BOOL bResizeColumns)
{
	LV_ITEM	lvItem;
	BOOL	bSuccessful = FALSE;

	ASSERT(pMLElement);

	//	Is the index within range
	if((iIndex < 0) || (iIndex >= this->GetItemCount()))
		iIndex = this->GetItemCount();

	memset(&lvItem, 0, sizeof(lvItem));
	lvItem.mask = LVIF_TEXT | LVIF_PARAM;
	lvItem.iItem = iIndex;
	lvItem.pszText = LPSTR_TEXTCALLBACK;
	lvItem.lParam = (LPARAM)pMLElement;

	//	Are we using images?
	if(m_bUseImages == TRUE)
	{
		lvItem.mask |= LVIF_IMAGE;
		lvItem.iImage = I_IMAGECALLBACK;
	}

	if((bSuccessful = (CListCtrl::InsertItem(&lvItem) != -1)) == TRUE)
	{
		if(bResizeColumns ==  TRUE)
			AutoSizeColumns();
	}

	return bSuccessful;
}
Esempio n. 3
0
void DataGrid::showAllData()
{
	updateData();
	SetRowLabelSize(wxGRID_AUTOSIZE);
	AutoSizeRows(false);
	AutoSizeColumns(false);
}
Esempio n. 4
0
bool CGridLocus::TransferDataToWindow()
{
    nwxGridBatch xxxx(this);
    const COARallele *pAllele;
    bool bAmel = m_pLocusEdited->IsAmel();
    vector<const COARallele *> va;
    m_pLocusEdited->GetAllelesByTime(&va,m_dtHistory);
    int nCol = (int)(va.size());
    _SetNumberCols(nCol);
    for(int k = 0; k < nCol; k++)
    {
        pAllele = va.at(k);
        SetCellValue(ROW_ALLELE,     k, pAllele->FormatName(bAmel,false));
        SetCellValue(ROW_BPS,        k, pAllele->FormatBPS());
        SetCellValue(ROW_OFF_LADDER, k, pAllele->FormatOffLadder());
        SetCellValue(ROW_HOMOZYGOUS, k, pAllele->FormatCount());
        SetCellValue(ROW_RFU,        k, pAllele->FormatRFU());
        SetCellValue(ROW_TIME,       k, pAllele->FormatTime());
        SetCellValue(ROW_PEAK_AREA,  k, pAllele->FormatPeakArea());
        SetCellValue(ROW_DISABLE,    k, pAllele->FormatDisabled());
        UpdateDisabledAlleles(k);
    }
    AutoSizeColumns();
    return true;
}
Esempio n. 5
0
DSPRegisterView::DSPRegisterView(wxWindow *parent, wxWindowID id)
	: wxGrid(parent, id, wxDefaultPosition, wxSize(130, 120))
{
	SetTable(new CDSPRegTable(), true);
	SetRowLabelSize(0);
	SetColLabelSize(0);
	DisableDragRowSize();

	AutoSizeColumns();
}
Esempio n. 6
0
CRegisterView::CRegisterView(wxWindow *parent, wxWindowID id)
	: wxGrid(parent, id)
{
	SetTable(new CRegTable(), true);
	SetRowLabelSize(0);
	SetColLabelSize(0);
	DisableDragRowSize();

	AutoSizeColumns();
}
void ctlResultGrid::fillGrid( PGresult * result )
{
    int    rowCount = PQntuples( result );
    int    colCount = PQnfields( result );

    // If this PGresult represents a non-query command 
    // (like an INSERT), there won't be any columns in 
    // the result set - just return

    if( colCount == 0 )
        return;

    // Disable repaints to we don't flicker too much

    BeginBatch();

    // Clear out the old results (if any) and resize 
    // grid to match the result set

    if( GetNumberRows())
        DeleteRows( 0, GetNumberRows());
    if( GetNumberCols())
        DeleteCols( 0, GetNumberCols());

    AppendRows( rowCount );
    AppendCols( colCount );

    EnableEditing( false );

    // Copy the column names from the result set into the column headers

    for( int col = 0; col < colCount; ++col )
        SetColLabelValue( col, wxString( PQfname( result, col ), wxConvUTF8 ));

    // Now copy each value from the result set into the grid

    for( int row = 0; row < rowCount; ++row )
    {
        for( int col = 0; col < colCount; ++col )
        {
            if( PQgetisnull( result, row, col ))
                SetCellValue( row, col, wxT( "" ));
            else
                SetCellValue( row, col, wxString( PQgetvalue( result, row, col ), wxConvUTF8 ));
        }
    }

    // Resize each column to fit its content

    AutoSizeColumns( false );

    // Enable repaints

    EndBatch();
}
Esempio n. 8
0
//------------------------------------------------------------------------------
//
// 	Function Name:	CMLListCtrl::Initialize()
//
//	Parameters:		pOwnerClass - an object of the class to be displayed
//					uResourceId - resource id for image list images
//
// 	Return Value:	None
//
// 	Description:	TRUE if successful
//
//------------------------------------------------------------------------------
BOOL CMLListCtrl::Initialize(CMLListCtrlElement* pOwnerClass, UINT uResourceId)
{
	CBitmap bmImages;

	SetExtendedStyle(GetExtendedStyle() | LVS_EX_FULLROWSELECT);

	//	Should we create an image list?
	if(uResourceId > 0)
	{
		//	Create the image list
		bmImages.LoadBitmap(uResourceId);
		m_aImages.Create(16, 16, ILC_MASK | ILC_COLOR24, 0, 1);
		m_aImages.Add(&bmImages, RGB(255,0,255));  

		//	Attach the image list
		SetImageList(&m_aImages, LVSIL_SMALL);

		m_bUseImages = TRUE;
	}

	//	Delete any columns that may have already been added to the list view
	if(this->GetHeaderCtrl() != 0)
	{
		while(this->GetHeaderCtrl()->GetItemCount() > 0)	
			this->DeleteColumn(0);
	}
	
	//	Delete the existing columns
	if(m_pColumns != 0)
	{
		m_pColumns->Flush(TRUE);
		delete m_pColumns;
		m_pColumns = 0;
	}

	//	Get the new column collection from the owner
	if(pOwnerClass != 0)
		m_pColumns = pOwnerClass->GetListCtrlColumns();

	//	Add the new columns
	if(m_pColumns != 0)
	{
		for(int i = 0; i <= m_pColumns->GetUpperBound(); i++)
		{
			if(m_pColumns->GetAt(i) != 0)
				Add(m_pColumns->GetAt(i), i);
		}

		AutoSizeColumns();

	}

	return TRUE;
}
Esempio n. 9
0
void MainPropGrid::LoadElement(Element* elementToShowProp)
{
	wxWindowUpdateLocker noUpdates(this); //Bloque la mise à jour de l'affichage
	this->CloseElement();
	
	CurrentElement=elementToShowProp;
	this->XmlIdElement=elementToShowProp->GetXmlId();
	CurrentElement->AppendWitness(LifeTimeWitness(new MainPropGridWitness(this,CurrentElement->GetXmlId())));
	this->SetColLabelValue(0,elementToShowProp->GetColTitle(0));
	this->idCurrentElement=elementToShowProp->GetElementInfos().idElement;

	elementToShowProp->InitProp();

	std::list<Element*> filsNoeud;
	elementToShowProp->GetChildElement(filsNoeud);

	//std::sort(filsNoeud.begin( ), filsNoeud.end( ), GridSortPredicate );
	filsNoeud.sort(GridSortPredicate);

	for(std::list<Element*>::iterator itfils=filsNoeud.begin();itfils!=filsNoeud.end();itfils++)
	{
		const Element::t_elementInfo& elinfos=(*itfils)->GetElementInfos();
		if(!elinfos.hidden && elinfos.typeElement!=Element::ELEMENT_TYPE_POSITION)
		{
			E_Data* elementFils=dynamic_cast<E_Data*>((*itfils));
			if(elementFils) //Si il s'agit d'un objet dérivé de data
			{
				try
				{
					rowInfo rowToAdd;
					rowToAdd.elementItem=elementFils;
					this->AppendRows(1);
					rowToAdd.rowNumber=this->GetNumberRows()-1;
					this->dataItems.push_back(rowToAdd);
					elementFils->FillWxGrid(this);
					AutoSizeLibelle(this->GetNumberRows()-1);
				}
				catch( ... )
				{
					wxLogDebug(_("Error in loading properties"));
					break;
				}
			}
		}
	}
	//Redimensionnement
	AutoSizeColumns(false);	
	//AutoSizeRows(false);
	this->SetRowLabelSize(wxGRID_AUTOSIZE);
	this->SetColLabelSize(wxGRID_AUTOSIZE);
	//ForceRefresh();
	//AutoSize  (   )  ;
}
Esempio n. 10
0
CRegisterView::CRegisterView(wxWindow* parent, wxWindowID id) : wxGrid(parent, id)
{
  m_register_table = new CRegTable();

  SetTable(m_register_table, true);
  SetRowLabelSize(0);
  SetColLabelSize(0);
  DisableDragRowSize();

  Bind(wxEVT_GRID_CELL_RIGHT_CLICK, &CRegisterView::OnMouseDownR, this);
  Bind(wxEVT_MENU, &CRegisterView::OnPopupMenu, this);

  AutoSizeColumns();
}
Esempio n. 11
0
void GUI_manager::add_IMG(const char* full_path_file_name) {
	int				item = ListView_GetItemCount(IMG_list);
	vector<internal_file>	TRE_file_list;
	char	tmp[1024];
	char	local_file_name[1024];
	char	t_file_type[255];
	char	drive[5];
	char	dir[1024];

	GetWindowText(region_name,tmp,1000);

	_splitpath(full_path_file_name,drive,dir,local_file_name,t_file_type);

	if( !strcmp(strupr( t_file_type ),".TXT" ) ) {
		FILE*	list = fopen(full_path_file_name,"r");
		char	file_name[1025];
		strcpy(tmp,"map");
		if( list ) {
			while( fgets(file_name,1024,list) != NULL ) {
				//remove 'non asci' chars!
				while( file_name[strlen(file_name)-1] < 32 && strlen(file_name))
					file_name[strlen(file_name)-1] = 0;
				if( strlen(file_name) ) {
					if( file_name[0] == ':' ) {
						strcpy(tmp,&file_name[1]);
					} else {
						uploader->add_img_file(file_name,&TRE_file_list,"",0,0,tmp,uploader->get_product_id(tmp));
					}
				}
			}
			fclose(list);
		}
	} else {
		uploader->add_img_file(full_path_file_name,&TRE_file_list,"",0,0,tmp,uploader->get_product_id(tmp));
	}
	
	for( vector<internal_file>::iterator f = TRE_file_list.begin(); f < TRE_file_list.end(); f++ ) {
		InsertItem(IMG_list, item , LPARAM("%s"),(*f).region_name.c_str());
		SetSubItemText (IMG_list, item, 1, "%s", (*f).TRE_map_name.c_str());
		SetSubItemText (IMG_list, item, 2, "%s", (*f).file_name.c_str());
		SetSubItemText (IMG_list, item, 3, "%s", (*f).get_internal_short_name());
	}
	AutoSizeColumns(IMG_list);
	show_size();
	
}
Esempio n. 12
0
void GUI_manager::enter_sync_mode(bool verbose) {
	char	b_title1[500];
	char	b_title2[500];
	int		item = ListView_GetItemCount(IMG_list);
	vector<internal_file> TRE_file_list;

	sync_mode = false;
	if( connect(true) == false )
		return;

	SetSelection(IMG_list,0);
	while( remove_IMG() )
		;

	loadString(IDS_SYNC_START,b_title1,sizeof(b_title1));
	loadString(IDS_SYNC_TITLE,b_title2,sizeof(b_title2));

	if( verbose ) {
		if( MessageBox(NULL,b_title1,b_title2,MB_ICONERROR | MB_YESNO) == IDYES ) {
			sync_mode = true;
		}
	} else 
		sync_mode = true;
	
	if( sync_mode ) {
		EnableWindow(GetDlgItem (gui_hwndDlg, IDC_IMG_FILE),FALSE);
		EnableWindow(GetDlgItem (gui_hwndDlg, IDC_EXE_FILE),FALSE);
		EnableWindow(GetDlgItem (gui_hwndDlg, IDC_STORE_FILES),FALSE);
		

		SetCursor (g_hWaitCursor);
			
		if( uploader->download_directory(&TRE_file_list) == true ) {
			item = ListView_GetItemCount(IMG_list);
			for( vector<internal_file>::iterator f = TRE_file_list.begin(); f < TRE_file_list.end(); f++ ) {
				InsertItem(IMG_list, item , LPARAM("%s"),(*f).region_name.c_str());
				SetSubItemText (IMG_list, item, 1, "%s", (*f).TRE_map_name.c_str());
				SetSubItemText (IMG_list, item, 2, "%s", (*f).file_name.c_str());
				SetSubItemText (IMG_list, item, 3, "%s", (*f).get_internal_short_name());
			}
			AutoSizeColumns(IMG_list);
			show_size();
		}
		SetCursor (g_hArrowCursor);
	}
}
Esempio n. 13
0
//------------------------------------------------------------------------------
//
// 	Function Name:	CMLListCtrl::Add()
//
//	Parameters:		pMLElements - a dynamic list of elements to be added
//					bClear - TRUE to clear existing contents
//
// 	Return Value:	None
//
// 	Description:	Called add all elements in the specified list
//
//------------------------------------------------------------------------------
void CMLListCtrl::Add(CObList* pMLElements, BOOL bClear)
{
	POSITION		Pos = NULL;
	CMLListCtrlElement*	pMLElement = NULL;

	if(bClear == TRUE)
		Clear();

	Pos = pMLElements->GetHeadPosition();
	while(Pos != NULL)
	{
		if((pMLElement = (CMLListCtrlElement*)(pMLElements->GetNext(Pos))) != 0)
			Add(pMLElement, FALSE);
	}

	AutoSizeColumns();
}
Esempio n. 14
0
BOOL CStructureDlg::OnInitDialog() 
{
	CDialogResize::OnInitDialog();
	
	DWORD dwStyle = m_FieldListCtrl.GetExtendedStyle();
	dwStyle |= (LVS_EX_FULLROWSELECT);
    m_FieldListCtrl.SetExtendedStyle(dwStyle);
	
	m_FieldListCtrl.InsertColumn(0, _T("Field Name"));
	m_FieldListCtrl.InsertColumn(1, _T("Type"));
	m_FieldListCtrl.InsertColumn(2, _T("Length"));
	m_FieldListCtrl.InsertColumn(3, _T("Decimals"));
	AutoSizeColumns(&m_FieldListCtrl);

	InitResizing();

	// iterate through all arguments and create a list of all the fields
	for (int i=0; i < m_strFieldArray.GetSize(); i++)
	{
		CString strBuff;
	
		m_FieldListCtrl.InsertItem(i, _T(""));

		for (int j=0; j < 4; j++)
		{
			AfxExtractSubString(strBuff, m_strFieldArray[i], j, ',');
			strBuff.TrimLeft();
			strBuff.TrimRight();
			m_FieldListCtrl.SetItemText(i, j, strBuff);
		}
	}
	
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	if (!m_strTitle.IsEmpty())
		SetWindowText(m_strTitle);

	CenterWindow();

	return TRUE;
}
void CGridAlerts::SetupLocusColumn(const vector<wxString> &vsLocus)
{

  int nRows = GetNumberRows();
  if((m_nLocusColumn >= 0) && (nRows > 0))
  {
    int nRow = 0;
    vector<wxString>::const_iterator itr;
    for(itr = vsLocus.begin();
      (nRow < nRows) && (itr != vsLocus.end());
      ++itr)
    {
      const wxString &s(*itr);
      SetCellValue(nRow++,m_nLocusColumn,s);
    }
    wxASSERT_MSG(
      (vsLocus.size() == (size_t) nRows),
      _T("Number of rows does not match number of loci"));
  }
  AutoSizeColumns();
}
//---------------------------------------------------------
void CVIEW_Table_Control::On_Autosize_Cols(wxCommandEvent &event)
{
	AutoSizeColumns(false);
}
//---------------------------------------------------------
void CActive_Attributes_Control::On_Autosize_Cols(wxCommandEvent &event)
{
	AutoSizeColumns(false);
}
//---------------------------------------------------------
bool CActive_Attributes_Control::Update_Table(void)
{
	if( GetBatchCount() > 0 )
	{
		return( false );
	}

	BeginBatch();

	//-----------------------------------------------------
	int	Difference	= (m_pTable->Get_Field_Count() - m_Field_Offset) - GetNumberCols();

	if( Difference > 0 )
	{
		AppendCols(Difference);
	}
	else if( (Difference = -Difference < GetNumberCols() ? -Difference : GetNumberCols()) > 0 )
	{	// here is (or was!?) a memory leak - solution: use own wxGridTableBase derived grid table class
		DeleteCols(0, Difference);
	}

	//-----------------------------------------------------
	for(int iCol=0, iField=m_Field_Offset; iField<m_pTable->Get_Field_Count(); iCol++, iField++)
	{
		SetColLabelValue(iCol, m_pTable->Get_Field_Name(iField));

		switch( m_pTable->Get_Field_Type(iField) )
		{
		default:
		case SG_DATATYPE_Byte:
		case SG_DATATYPE_Char:
		case SG_DATATYPE_String:
		case SG_DATATYPE_Date:
		case SG_DATATYPE_Binary:
			SetColFormatCustom(iCol, wxGRID_VALUE_STRING);
			break;

		case SG_DATATYPE_Bit:
		case SG_DATATYPE_Word:
		case SG_DATATYPE_Short:
		case SG_DATATYPE_DWord:
		case SG_DATATYPE_Int:
		case SG_DATATYPE_ULong:
		case SG_DATATYPE_Long:
		case SG_DATATYPE_Color:
			SetColFormatNumber(iCol);
			break;

		case SG_DATATYPE_Float:
		case SG_DATATYPE_Double:
			SetColFormatFloat(iCol);
			break;
		}
	}

	//-----------------------------------------------------
	if( (Difference = m_pTable->Get_Count() - GetNumberRows()) > 0 )
	{
		AppendRows(Difference);
	}
	else if( Difference < 0 && (Difference = -Difference < GetNumberRows() ? -Difference : GetNumberRows()) > 0 )
	{
		DeleteRows(0, Difference);
	}

	//-------------------------------------------------
	for(int iRecord=0; iRecord<m_pTable->Get_Count(); iRecord++)
	{
		_Set_Record(iRecord);
	}

	//-----------------------------------------------------
	if( GetNumberCols() > 0 && GetNumberRows() > 0 )
	{
		SetRowLabelSize(wxGRID_AUTOSIZE);

		if( m_Field_Offset )	// feature attributes
		{
			if( GetClientSize().x > GetRowLabelSize() )
			{
				SetColSize(0, GetClientSize().x - GetRowLabelSize());
			}
		}
		else					// grid cell values
		{
			AutoSizeColumns();
		}
	}

	Enable(GetNumberRows() > 0);

	m_pTable->Set_Modified(false);

	//-----------------------------------------------------
	EndBatch();

	return( true );
}
Esempio n. 19
0
wxMacDataBrowserListControl::wxMacDataBrowserListControl( wxWindow *peer, const wxPoint& pos, const wxSize& size, long style)
    : wxMacDataItemBrowserControl( peer, pos, size, style )
{
    m_nextColumnId = 0 ;

    OSStatus err = noErr;
    m_clientDataItemsType = wxClientData_None;
    if ( style & wxLB_SORT )
        m_sortOrder = SortOrder_Text_Ascending;

    DataBrowserSelectionFlags  options = kDataBrowserDragSelect;
    if ( style & wxLB_MULTIPLE )
    {
        options |= kDataBrowserAlwaysExtendSelection | kDataBrowserCmdTogglesSelection;
    }
    else if ( style & wxLB_EXTENDED )
    {
        options |= kDataBrowserCmdTogglesSelection;
    }
    else
    {
        options |= kDataBrowserSelectOnlyOne;
    }
    err = SetSelectionFlags( options );
    verify_noerr( err );

    DataBrowserListViewColumnDesc columnDesc;
    columnDesc.headerBtnDesc.titleOffset = 0;
    columnDesc.headerBtnDesc.version = kDataBrowserListViewLatestHeaderDesc;

    columnDesc.headerBtnDesc.btnFontStyle.flags =
        kControlUseFontMask | kControlUseJustMask;

    columnDesc.headerBtnDesc.btnContentInfo.contentType = kControlNoContent;
    columnDesc.headerBtnDesc.btnFontStyle.just = teFlushDefault;
    columnDesc.headerBtnDesc.btnFontStyle.font = kControlFontViewSystemFont;
    columnDesc.headerBtnDesc.btnFontStyle.style = normal;
    columnDesc.headerBtnDesc.titleString = NULL;
/*
    columnDesc.headerBtnDesc.minimumWidth = 0;
    columnDesc.headerBtnDesc.maximumWidth = 10000;

    columnDesc.propertyDesc.propertyID = kTextColumnId;
    columnDesc.propertyDesc.propertyType = kDataBrowserTextType;
    columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
    columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;

    verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );
*/
    columnDesc.headerBtnDesc.minimumWidth = 0;
    columnDesc.headerBtnDesc.maximumWidth = 0;
    columnDesc.propertyDesc.propertyID = kNumericOrderColumnId;
    columnDesc.propertyDesc.propertyType = kDataBrowserPropertyRelevanceRankPart;
    columnDesc.propertyDesc.propertyFlags = kDataBrowserTableViewSelectionColumn;
    columnDesc.propertyDesc.propertyFlags |= kDataBrowserListViewTypeSelectColumn;

    verify_noerr( AddColumn( &columnDesc, kDataBrowserListViewAppendColumn ) );

/*
    SetDataBrowserSortProperty( m_controlRef , kTextColumnId);
    if ( m_sortOrder == SortOrder_Text_Ascending )
    {
        SetDataBrowserSortProperty( m_controlRef , kTextColumnId);
        SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
    }
    else
*/
    {
        SetDataBrowserSortProperty( m_controlRef , kNumericOrderColumnId);
        SetDataBrowserSortOrder( m_controlRef , kDataBrowserOrderIncreasing);
    }

    verify_noerr( AutoSizeColumns() );
    verify_noerr( SetHiliteStyle(kDataBrowserTableViewFillHilite ) );
    verify_noerr( SetHeaderButtonHeight( 0 ) );
    err = SetHasScrollBars( (style & wxHSCROLL) != 0 , true );
#if 0
    // shouldn't be necessary anymore under 10.2
    GetPeer()->SetData( kControlNoPart, kControlDataBrowserIncludesFrameAndFocusTag, (Boolean)false );
    GetPeer()->SetNeedsFocusRect( true );
#endif
}
Esempio n. 20
0
int CALLBACK GUI_Dialog(HWND hwndDlg, UINT uMsg,WPARAM wParam, LPARAM lParam) {
	switch (uMsg) {
		case WM_INITDIALOG:
			
			gui_manager.gui_hwndDlg = hwndDlg;
			//Initialisation of GUI here
			DragAcceptFiles(hwndDlg, true); 

			gui_manager.EXE_check = GetDlgItem (hwndDlg, IDC_EXE_FILE);
			gui_manager.GMAPSUPP_check = GetDlgItem (hwndDlg, IDC_IMG_FILE);
			gui_manager.nt_format = GetDlgItem (hwndDlg, IDC_NT_FORMAT);

			//ports			
			gui_manager.PORT_list = GetDlgItem (hwndDlg, IDC_PORTS);			

			//mapset
			gui_manager.mapset_name = GetDlgItem(hwndDlg, IDC_EDIT_MAPSET);

			//old header
			gui_manager.old_header = GetDlgItem(hwndDlg, IDC_OLD_HEADER);
#if FULL != 1
			EnableWindow(gui_manager.mapset_name,FALSE);
#endif

			SendMessage(gui_manager.old_header,BM_SETCHECK,0,0);

			//region
			gui_manager.region_name = GetDlgItem(hwndDlg, IDC_EDIT_REGION);

			//unlock key
			//gui_manager.key_value = GetDlgItem(hwndDlg, IDC_EDIT_KEY);

			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("Auto")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("usb")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com1")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com2")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com3")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com4")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com5")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com6")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com7")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com8")); 
			SendMessage(gui_manager.PORT_list, CB_INSERTSTRING, -1, LPARAM("com9")); 
			SendMessage(gui_manager.PORT_list, CB_SETCURSEL, 0, 0); 
			PORT_list_original_proc = (WNDPROC) SetWindowLong(gui_manager.PORT_list , GWL_WNDPROC, (DWORD) PORT_list_proc); 

			//speeds
			gui_manager.SPEED_list = GetDlgItem (hwndDlg, IDC_SPEEDS);

			SendMessage(gui_manager.SPEED_list, CB_INSERTSTRING, -1, LPARAM("115200")); 
			SendMessage(gui_manager.SPEED_list, CB_INSERTSTRING, -1, LPARAM("57600")); 
			SendMessage(gui_manager.SPEED_list, CB_INSERTSTRING, -1, LPARAM("38400")); 
			SendMessage(gui_manager.SPEED_list, CB_INSERTSTRING, -1, LPARAM("19200")); 
			SendMessage(gui_manager.SPEED_list, CB_INSERTSTRING, -1, LPARAM("9600")); 
			SendMessage(gui_manager.SPEED_list, CB_SETCURSEL, 1, 0); 

			EnableWindow(gui_manager.SPEED_list,FALSE);

			//IMG list
			gui_manager.IMG_list = GetDlgItem (hwndDlg, IDC_IMG_LIST);
			ListView_SetExtendedListViewStyleEx (gui_manager.IMG_list, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT);
			AddColumn (gui_manager.IMG_list, 0, "Region");
			AddColumn (gui_manager.IMG_list, 1, "Name");
			AddColumn (gui_manager.IMG_list, 2, "File");
			AddColumn (gui_manager.IMG_list, 3, "Internal");
			AutoSizeColumns(gui_manager.IMG_list);

			IMG_list_original_proc = (WNDPROC) SetWindowLong(gui_manager.IMG_list , GWL_WNDPROC, (DWORD) IMG_list_proc); 

			//Language - polski ;)
			changeTitle(hwndDlg,ID_CONNECT,IDS_CONNECT);
			changeTitle(hwndDlg,IDC_REMOVE_MAPS,IDS_REMOVE_MAPS);
			changeTitle(hwndDlg,IDC_ADD_MAPS,IDS_ADD_MAPS);
			changeTitle(hwndDlg,IDC_EXIT,IDS_EXIT);
			changeTitle(hwndDlg,IDC_UPLOAD,IDS_UPLOAD);
			changeTitle(hwndDlg,IDC_ERASE,IDS_ERASE);
			changeTitle(hwndDlg,IDC_MAPS_STATIC,IDS_MAPS_STATIC);
			changeTitle(hwndDlg,IDC_SIZE_STATIC,IDS_SIZE_STATIC);
			changeTitle(hwndDlg,IDC_DEVICE_STATIC,IDS_DEVICE_STATIC);
			changeTitle(hwndDlg,IDC_SPEED_STATIC,IDS_SPEED_STATIC);
			//changeTitle(hwndDlg,IDC_FOUND_STATIC,IDS_FOUND_STATIC);
			changeTitle(hwndDlg,IDC_SYNC_GPS,IDS_SYNC_GPS);

			changeTitle(hwndDlg,IDC_IMG_FILE,IDS_IMG_FILE);
			changeTitle(hwndDlg,IDC_EXE_FILE,IDS_EXE_FILE);
			
			changeTitle(hwndDlg,IDC_ADD_UNLOCK,IDS_ADD_UNLOCK);

			SendMessage(GetDlgItem (hwndDlg, IDC_EDIT_MAPSET),WM_SETTEXT,0,LPARAM("Maps uploaded with SendMap"));
			//SendMessage(GetDlgItem (hwndDlg, IDC_EDIT_KEY),WM_SETTEXT,0,LPARAM("enter unlock key here"));
			SendMessage(GetDlgItem (hwndDlg, IDC_EDIT_REGION),WM_SETTEXT,0,LPARAM("mapset"));
			break;
		case WM_DROPFILES: {
			const HDROP hDrop = reinterpret_cast <HDROP> (wParam);
			UINT c = 0;
			while (true) {
				char strFileName [MAX_PATH + 1];
				if (::DragQueryFile (hDrop, c ++, strFileName, MAX_PATH) == 0)
					break;

				gui_manager.add_IMG(strFileName);
			}
			::DragFinish (hDrop);
			break;
			}
        case WM_COMMAND:
			switch(LOWORD(wParam)) {
				case IDC_STORE_FILES:
					gui_manager.store_files();
					break;
				case IDC_EXE_FILE:
					gui_manager.create_exe();
					break;
				case IDC_IMG_FILE:
					gui_manager.create_GMAPSUPP();
					break;
				case IDC_ADD_UNLOCK:
					gui_manager.add_unlock_key();
					break;
				case IDC_SYNC_GPS:
					gui_manager.enter_sync_mode();
					break;
				case IDC_ADD_MAPS:
					gui_manager.open_file_add_IMG();
					break;
				case IDC_EXIT:
				case 2:
					DestroyWindow(gui_manager.dialog );
					return 0;
				case IDC_ERASE:
					gui_manager.erase();
					break;
				case ID_CONNECT:
					gui_manager.connect(true);
					break;
				case IDC_REMOVE_MAPS:
					gui_manager.remove_IMG();
					break;
				case IDC_UPLOAD:
					gui_manager.upload();
					break;
			}
			break;
		case WM_DESTROY: 
			PostQuitMessage(0); 
			return 0;
	}

	return 0;
}
/*
	LoadList()
*/
int CWallBrowserFileView::LoadList(LPCSTR lpcszPathName)
{
	CWaitCursor cursor;

	CWallBrowserDoc* pDoc = (CWallBrowserDoc*)GetDocument();
	if(!pDoc)
		return(0);

	CImage* pImage = pDoc->GetImage();
	if(!pImage)
		return(0);
	
	CString strPath = lpcszPathName;
	if(strPath.Right(1)!="\\")
		strPath += "\\";
	strPath += "*.*";

	HANDLE hFind;
	WIN32_FIND_DATA fd;

	m_nFiles = m_nPictures = 0;

	SetRedraw(FALSE);

	if((hFind = ::FindFirstFile((LPCTSTR)strPath,&fd))!=INVALID_HANDLE_VALUE)
	{
		if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
		{
			m_nFiles++;

			if(pImage->IsImageFile(fd.cFileName))
			{
				if(AddItem(m_nPictures,&fd))
					m_nPictures++;
			}
		}

		while(::FindNextFile(hFind,&fd))
		{
			if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
			{
				m_nFiles++;

				if(pImage->IsImageFile(fd.cFileName))
				{
					if(AddItem(m_nPictures,&fd))
						m_nPictures++;
					else
						break;
				}
			}
		}
	
		::FindClose(hFind);
	}

	if(m_nPictures > 0)
		GetListCtrl().SortItems(CompareFunc,g_nSortOrder);

	BOOL bAutoSizeCols = TRUE;
	CWinAppEx* pWinAppEx = (CWinAppEx*)AfxGetApp();
	if(pWinAppEx)
		bAutoSizeCols = pWinAppEx->m_Config.GetNumber(WALLBROWSER_OPTIONS_KEY,WALLBROWSER_AUTOSIZECOLUMNS_KEY);
	if(bAutoSizeCols)
		AutoSizeColumns();
	
	SetRedraw(TRUE);

	pDoc->SetTitle(lpcszPathName);

	return(m_nPictures);
}
CGridAlerts::CGridAlerts(
  COARmessages *pMsgEdit,
  wxWindow *parent,
  wxWindowID id,
  int nType,
  bool bReadOnly) :
    _CGridEdit(parent,id,bReadOnly),
    m_pMsgEdit(pMsgEdit),
    m_nChannelColumn(-1),
    m_nLocusColumn(-1),
    m_nInCellChangeEvent(0)
{
  int bChannel = !!(nType & TYPE_CHANNEL);
  int bLocus = !!(nType & TYPE_LOCUS);
  size_t nCount = m_pMsgEdit->GetMessageCount();
  if(nCount)
  {
    const wxString sDisable(_T("Enabled"));
    int nColCount = 2 + bChannel + bLocus;
    int nCol = nColCount;
    CreateGrid((int)nCount,nColCount);
    SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE);
    SetColLabelValue(--nCol,_T("Alert"));
    SetColLabelValue(--nCol,sDisable);
    if(bChannel)
    {
      SetColLabelValue(--nCol,LABEL_CHANNEL);
      m_nChannelColumn = nCol;
    }
    if(bLocus)
    {
      SetColLabelValue(--nCol,LABEL_LOCUS);
      m_nLocusColumn = nCol;
    }
    SetRowLabelSize(2);
    for(size_t j = 0; j < nCount; j++)
    {
      nCol = nColCount;
      SetCellAlignment((int)j,--nCol,wxALIGN_LEFT,wxALIGN_CENTRE);
      SetBoolCell((int)j,--nCol);
      SetCellAlignment((int)j,nCol,wxALIGN_CENTRE,wxALIGN_CENTRE);
      if(bChannel)
      {
        SetCellAlignment((int)j,m_nChannelColumn,wxALIGN_CENTRE,wxALIGN_CENTRE);
        SetReadOnly((int)j,m_nChannelColumn,true);
      }
      if(bLocus)
      {
        SetCellAlignment((int)j,m_nLocusColumn,wxALIGN_LEFT,wxALIGN_CENTRE);
        SetReadOnly((int)j,m_nLocusColumn,true);
      }
      SetRowLabelValue((int)j,wxEmptyString);
    }
    TransferDataToWindow();
    SetColLabelSize(GetRowSize(0));
  }
  else
  {
    CreateGrid(1,1);
    nwxGrid::SetMessageGrid(this,_T("There are no " COAR_NOTICE_DISPLAY));
  }
  AutoSizeColumns();
  DisableDragRowSize();
  if(bReadOnly)
  {
    DisableDragColSize();
  }
}