예제 #1
0
nuiButton::nuiButton(const nglImage& rImage)
  : nuiSimpleContainer(), mEventSink(this)
{
  if (SetObjectClass(_T("nuiButton")))
  {
    InitAttributes();
  }
  mClicked = false;
  mPressed = false;
  mAutoRepeat = false;
  mRepeatDelay = 0.5;
  mRepeatMinDelay = 0.01;
  mpAutoRepeatTimer = NULL;
  mActivationOffset = DEFAULT_ACTIVATION_OFFSET;
  SetRedrawOnHover(true);
  EnableInteractiveDecoration(true);

  nuiImage* pImage = new nuiImage(rImage);
  AddChild(pImage);
  pImage->SetPosition(nuiCenter);
  
  SetBorders(mDefaultBorders);
  SetWantKeyboardFocus(true);
  SetFocusVisible(true);
  mpTask = NULL;
  
  NUI_ADD_EVENT(ButtonPressed);
  NUI_ADD_EVENT(ButtonDePressed);
  NUI_ADD_EVENT(ButtonDePressedInactive);
  NUI_ADD_EVENT(Activated);
}
CGLWorkspace::CGLWorkspace(CGLObject *parent, const QPointF &position, const QPointF &size, TLayoutType layoutType):
CGLObject(parent, position, size)
{
	WorkLog.write("Begin: CGLWorkspace::CGLWorkspace");	
	iLayout = NULL;
	iLastInnerHeight = 0;
	iLastInnerWidth = 0;
	iWorkspaceChanged = true;
	iName = new QString();
	iSaveSnapshot = false;
	iSaveSnapshotFileName = NULL;
	QString name;
	name.clear();
	name.append("WS:");
	name.append(QString::number(CWorkspaceManager::GetInstance()->GetWorkspaces().count()));
	SetName(name);
	iActiveImage = NULL;
	SetLayout(layoutType);
	if(!InitTexture())
	{
		int err=1;
		throw TextureNotCreatedException();
	}
	iWorkspaceSnapshot =new CGLWorkspaceSnapshot(parent,this,QPointF(10,10), QPointF(100,100));
	SetBorders(Settings::GetBordersConstant(EWorkspaceBorders));
	SetBorderColor(Settings::GetColorConstant(EWorkspaceBorderColor));
	SetInnerColor(Settings::GetColorConstant(EWorkspaceInnerColor));
	WorkLog.write("End: CGLWorkspace::CGLWorkspace");	
}
예제 #3
0
nuiButton::nuiButton(nuiDecoration* pDeco, bool AlreadyAcquired)
: nuiSimpleContainer(), mEventSink(this)
{
  if (SetObjectClass(_T("nuiButton")))
  {
    InitAttributes();
  }
  mClicked = false;
  mPressed = false;
  mAutoRepeat = false;
  mRepeatDelay = 0.5;
  mRepeatMinDelay = 0.01;
  mpAutoRepeatTimer = NULL;
  mActivationOffset = DEFAULT_ACTIVATION_OFFSET;
  SetRedrawOnHover(true);
  EnableInteractiveDecoration(true);
  
  SetDecoration(pDeco, eDecorationOverdraw, AlreadyAcquired);
  
  SetBorders(mDefaultBorders);
  SetWantKeyboardFocus(true);
  SetFocusVisible(true);
  mpTask = NULL;
  
  NUI_ADD_EVENT(ButtonPressed);
  NUI_ADD_EVENT(ButtonDePressed);
  NUI_ADD_EVENT(ButtonDePressedInactive);
  NUI_ADD_EVENT(Activated);
}
CGLPlanarWorkspace::CGLPlanarWorkspace(CGLObject *parent, const QPointF &position, const QPointF &size):
    CGLObject(parent, position, size) {
    PlanWorkLog.write("Begin: CGLPlanarWorkspace::CGLPlanarWorkspace");
    //iLayout = NULL;
    iLastInnerHeight = 0;
    iLastInnerWidth = 0;
    iWorkspaceChanged = true;
    iName = new QString();
    iSaveSnapshot = false;
    iSaveSnapshotFileName = NULL;
    QString name;
    name.clear();
    name.append("MPS");
    //name.append(QString::number(CWorkspaceManager::GetInstance()->GetWorkspaces().count()));
    SetName(name);
    iImage = NULL;
    //SetLayout(layoutType);
    iWorkspaceSnapshot =new CGLWorkspaceSnapshot(parent,(CGLWorkspace*)this,QPointF(10,10), QPointF(100,100));
    SetBorders(Settings::GetBordersConstant(EWorkspaceBorders));
    SetBorderColor(Settings::GetColorConstant(EWorkspaceBorderColor));
    SetInnerColor(Settings::GetColorConstant(EWorkspaceInnerColor));
    iPlanarCrossPosition.x=0.5;
    iPlanarCrossPosition.y=0.5;
    iPlanarCrossPosition.z=0.5;
    setMouseTracking(true);
    iEventHistory = new QPoint();
    iCursorHistory = new QPoint();
    iSensitivity = 1000;
}
예제 #5
0
//********************************************************************************
BOOL CCxLoginBar::CreateEx (CWnd* pParentWnd, DWORD /*dwCtrlStyle*/, DWORD dwStyle, 
							 UINT nID)
{
	ASSERT_VALID(pParentWnd);   // must have a parent

	m_dwStyle |= CBRS_HIDE_INPLACE;

	//dwStyle &= ~CBRS_GRIPPER;

	m_dwStyle = (dwStyle & CBRS_ALL);
	// save the style
	SetBarAlignment (dwStyle & CBRS_ALL);

	SetBorders (CRect(1, 0, 1, 0));

	// create the HWND
	CRect rect;
	rect.SetRectEmpty();

#ifndef _BCGSUITE_
	m_dwBCGStyle = 0; // can't float, resize, close, slide
#else
	m_dwControlBarStyle = 0; // can't float, resize, close, slide
#endif

	if (!CBCGPBaseToolBar::Create (
		globalData.RegisterWindowClass (_T("CCxLoginBar")), dwStyle, rect, pParentWnd, nID, 0))
	{
		return FALSE;
	}

	////if (!CWnd::Create (globalData.RegisterWindowClass (_T("CCxLoginBar")),
	//if (!CWnd::Create (globalData.RegisterWindowClass (_T("CCxLoginBar")),
	//	NULL, dwStyle | WS_CLIPSIBLINGS, rect, pParentWnd, nID))
	//{
	//	return FALSE;
	//}

	//if (pParentWnd->IsKindOf (RUNTIME_CLASS (CBCGPFrameWnd)))
	//{
	//	((CBCGPFrameWnd*) pParentWnd)->AddControlBar (this);
	//}
	//else if (pParentWnd->IsKindOf (RUNTIME_CLASS (CBCGPMDIFrameWnd)))
	//{
	//	((CBCGPMDIFrameWnd*) pParentWnd)->AddControlBar (this);
	//}
	//else
	//{
	//	ASSERT (FALSE);
	//	return FALSE;
	//}

	m_ToolTip.Create(this);
	return TRUE;
}
예제 #6
0
BOOL CToolBarXP::LoadToolBar (UINT nIDResource)
{
    if ( !CToolBar::LoadToolBar (nIDResource) )
    {
        return false;
    }
    SetBorders (CRect(1,3,6,4));
    SendMessage (TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);

    return true;
}
예제 #7
0
CSizableReBar::CSizableReBar()
{
    m_bTracking   = false;
    m_cxEdge      = 3;
    m_cyEdge      = 3;
    m_hbmBack     = 0;
    m_bCommonPart = true;
    m_bCustomPart = true;
    m_bLocked     = false;

    SetBorders();
}
예제 #8
0
ProgressBar::ProgressBar(void): m_minValue(0.f), m_maxValue(100.f), m_currentValue(0.f), m_size(125.f, 9.f), m_frameColor(Color::Gray())
{
    SetBorders(2.f, 2.f);
    UpdateDstPoint();

    m_frameShape.SetStyle(Shape::SS_LINE_LOOP);
    m_frameShape.AddRectangle(Point2f(), m_size);
    m_frameShape.MakeArrays();
    
    m_innerShape.SetStyle(Shape::SS_FILL);
    m_innerShape.AddRectangle(m_innerStart, m_dstPoint);
    m_innerShape.MakeArrays();
}
예제 #9
0
CImageExplorer::CImageExplorer(CWidget *parentWindow, QPointF& position, QPointF &size ):CObject (parentWindow, position, size)
{	
	iActiveImage = NULL;
	iScrollBar = new QScrollBar(Qt::Vertical,parentWindow);
	iScrollBar->setMinimum(0);
	iScrollBar->setMaximum(0);
	iScrollBar->setValue(0);
	QObject::connect(iScrollBar , SIGNAL(valueChanged(int)), 
		this, SLOT(Scrolled(int))); 
	SetBorders(Settings::GetBordersConstant(EImageExplorerBorders));
	SetBorderColor(Settings::GetColorConstant(EImageExplorerBorderColor));
	SetInnerColor(Settings::GetColorConstant(EImageExplorerInnerColor));
}
예제 #10
0
CPlanarWorkspace::CPlanarWorkspace(CObject *parent, const QPointF &position, const QPointF &size):
CObject(parent, position, size){
	//iLayout = NULL;
	iLastInnerHeight = 0;
	iLastInnerWidth = 0;
	iWorkspaceChanged = true;
	iName = new QString();
	iSaveSnapshot = false;
	iSaveSnapshotFileName = NULL;
	QString name;
	name.clear();
	name.append("MPR");
	//name.append(QString::number(CWorkspaceManager::GetInstance()->GetWorkspaces().count()));
	SetName(name);
	iImage = NULL;
	//SetLayout(layoutType);
	iWorkspaceSnapshot =new CWorkspaceSnapshot(parent,(CWorkspace*)this,QPointF(400,400), QPointF(100,100));
	SetBorders(Settings::GetBordersConstant(EWorkspaceBorders));
	SetBorderColor(Settings::GetColorConstant(EWorkspaceBorderColor));
	SetInnerColor(Settings::GetColorConstant(EWorkspaceInnerColor));
	iPlanarCrossPosition.x=0.5;
	iPlanarCrossPosition.y=0.5;
	iPlanarCrossPosition.z=0.5;
	setMouseTracking(true);
	iEventHistory = new QPoint();
	iCursorHistory = new QPoint();
	iSensitivity = 1000;

	CImage* image = CImageExplorer::GetInstance()->iActiveImage;
	iImage1 = image->CreateDerivedImage(EImageOrientationAxial);
	iImage2 = image->CreateDerivedImage(EImageOrientationAxial);
	iImage3 = image->CreateDerivedImage(EImageOrientationAxial);
	iImage1->SetOrientation(EImageOrientationAxial);
	iImage2->SetOrientation(EImageOrientationSagittal);
	iImage3->SetOrientation(EImageOrientationCoronal);
	iImage1->SetGeometry(0, 0, iSize.x()/2, iSize.y()/2);
	iImage2->SetGeometry(iSize.x()/2, 0, iSize.x()/2, iSize.y()/2);
	iImage3->SetGeometry(0, iSize.y()/2, iSize.x()/2, iSize.y()/2);
	float textureWidth = (float)iImage1->GetTexture()->GetWidth();
	int textureHeight = iImage1->GetTexture()->GetHeight();
	int textureDepth = iImage1->GetTexture()->GetDepth();
	float zoom = iImage1->GetSize().x()/textureWidth;
	iImage1->SetZoom(zoom);
	iImage2->SetZoom(zoom);
	iImage3->SetZoom(zoom);
	iImage1->MoveToDepth(0.5);
	iImage2->MoveToDepth(0.5);
	iImage3->MoveToDepth(0.5);
	CWidget::GetInstance()->paint();
}
예제 #11
0
int CBCGPMSMToolBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CBCGPToolBar::OnCreate(lpCreateStruct) == -1)
		return -1;

	SetBarStyle((GetBarStyle () & 
		~(CBRS_GRIPPER | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT))
		| CBRS_SIZE_DYNAMIC);
	SetBorders ();
	
	SetGrayDisabledButtons (FALSE);

	return 0;
}
예제 #12
0
void CRuntimeDlg::SetBordersDLU(int nLeft, int nTop, int nRight, int nBottom)
{
	if (GetSafeHwnd())
	{
		CDlgUnits dlu(*this);
		
		dlu.ToPixels(nLeft, nTop);
		dlu.ToPixels(nRight, nBottom);
		
		SetBorders(nLeft, nTop, nRight, nBottom);
	}
	else
	{
		m_rBorders.SetRectEmpty();
		m_rBordersDLU.SetRect(max(0, nLeft), max(0, nTop), max(0, nRight), max(0, nBottom));
	}
}
TH2F* FixAndSetBorders( const TH2& hist, const char* name=0, const char* title=0, Double_t val=0 ) {
    TH2F* hist0 = (TH2F*)hist.Clone(); // histogram we can modify

    MirrorBorders( *hist0 );    // mirror values of border bins into overflow bins

    TH2F* hist1 = AddBorders( *hist0, "hist1", "hist1" );   
    // add new border of bins around original histogram,
    // ... so 'overflow' bins become normal bins
    SetBorders( *hist1, val );                              
    // set overflow bins to value 1

    TH2F* histX = AddBorders( *hist1, "histX", "histX" );   
    // add new border of bins around original histogram,
    // ... so 'overflow' bins become normal bins

    TH2F* hist3 = (TH2F*)histX->Clone();
    hist3->SetName( name!=0 ? name : "hist3" );
    hist3->SetTitle( title!=0 ? title : "hist3" );

    delete hist0; delete hist1; delete histX;
    return hist3; // this can be used for filled contour histograms
}
예제 #14
0
SjHtmlWindow::SjHtmlWindow(wxWindow* parent, int id, const wxPoint& pos, const wxSize& size, long style)
	: wxHtmlWindow(parent, id, pos, size, style)
{
	wxFont guiFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
	if( g_accelModule->m_flags&SJ_ACCEL_USE_VIEW_FONT_IN_DLG )
	{
		guiFont = g_mainFrame->m_baseStdFont;
	}

	int normalFontSize = guiFont.GetPointSize();
	int largeFontSize  = (int)((float)normalFontSize*1.5);

	int sizes[7] =
	{
		normalFontSize, normalFontSize, normalFontSize,
		normalFontSize,
		normalFontSize, largeFontSize, largeFontSize
	};

	SetFonts(guiFont.GetFaceName(), wxT(""), sizes);
	SetBorders(SJ_DLG_SPACE*2);
}
예제 #15
0
CBCGPReBar::CBCGPReBar() : m_Impl (this)
{
	m_bLocked = FALSE;
	SetBorders();
}
예제 #16
0
LRESULT CToolbarWnd::OnInitDialog(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
    Default();
    InitWindowStyles(this);

    //(void)m_sizeDefault; // not yet set
    CRect sizeDefault;
    GetWindowRect(&sizeDefault);
    CRect rcBorders(4, 4, 4, 4);
    SetBorders(&rcBorders);
    m_szFloat.cx = sizeDefault.Width() + rcBorders.left + rcBorders.right + GetSystemMetrics(SM_CXEDGE) * 2;
    m_szFloat.cy = sizeDefault.Height() + rcBorders.top + rcBorders.bottom + GetSystemMetrics(SM_CYEDGE) * 2;
    m_szMRU = m_szFloat;
    UpdateData(FALSE);

    // Initalize the toolbar
    CImageList iml;
    int nFlags= theApp.m_iDfltImageListColorFlags;
    // older Windows versions imageslists cannot create monochrome (disabled) icons which have alpha support
    // so we have to take care of this ourself
    bool bNeedMonoIcons = thePrefs.GetWindowsVersion() < _WINVER_VISTA_ && nFlags != ILC_COLOR4;
    nFlags |= ILC_MASK;
    iml.Create(16, 16, nFlags, 1, 1);
    iml.Add(CTempIconLoader(_T("FILEPRIORITY")));
    iml.Add(CTempIconLoader(_T("PAUSE")));
    iml.Add(CTempIconLoader(_T("STOP")));
    iml.Add(CTempIconLoader(_T("RESUME")));
    iml.Add(CTempIconLoader(_T("DELETE")));
    iml.Add(CTempIconLoader(_T("OPENFILE")));
    iml.Add(CTempIconLoader(_T("PREVIEW")));
    iml.Add(CTempIconLoader(_T("FILEINFO")));
    iml.Add(CTempIconLoader(_T("FILECOMMENTS")));
    iml.Add(CTempIconLoader(_T("ED2KLINK")));
    iml.Add(CTempIconLoader(_T("CATEGORY")));
    iml.Add(CTempIconLoader(_T("CLEARCOMPLETE")));
    iml.Add(CTempIconLoader(_T("KadFileSearch")));
    iml.Add(CTempIconLoader(_T("Search")));

    if (bNeedMonoIcons)
    {
        CImageList iml2;
        iml2.Create(16, 16, nFlags, 1, 1);
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("FILEPRIORITY"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("PAUSE"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("STOP"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("RESUME"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("DELETE"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("OPENFILE"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("PREVIEW"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("FILEINFO"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("FILECOMMENTS"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("ED2KLINK"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("CATEGORY"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("CLEARCOMPLETE"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("KadFileSearch"))));
        VERIFY(AddIconGrayscaledToImageList(iml2, CTempIconLoader(_T("Search"))));
        CImageList* pImlOld = m_btnBar->SetDisabledImageList(&iml2);
        iml2.Detach();
        if (pImlOld)
            pImlOld->DeleteImageList();
    }
    CImageList* pImlOld = m_btnBar->SetImageList(&iml);
    iml.Detach();
    if (pImlOld)
        pImlOld->DeleteImageList();




    m_btnBar->ModifyStyle((theApp.m_ullComCtrlVer >= MAKEDLLVERULL(6, 16, 0, 0)) ? TBSTYLE_TRANSPARENT : 0, 0);
    m_btnBar->SetMaxTextRows(0);

    FillToolbar();

    return TRUE;
}
예제 #17
0
BOOL CRRECToolBar::Create(CWnd* parent, LPCTSTR szImageFile, COLORREF crMask)
{
	if (CreateEx(parent, TBSTYLE_FLAT | TBSTYLE_WRAPABLE, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP | CBRS_SIZE_DYNAMIC/* | WS_CLIPCHILDREN*/, 
				CRect(0, 0, 0, 0), TOOLBAR_CONTROL) && LoadToolBar(TOOLBAR_CONTROL))
	{
		if (szImageFile)
			SetImage(szImageFile, crMask);
		else 
			SetImage(IDB_TOOLBAR, RGB(255, 0, 255));

		// very important - turn OFF all the auto positioning and sizing
		// by default have no borders
		UINT nStyle = GetBarStyle();
	//	nStyle &= ~(CCS_NORESIZE | CCS_NOPARENTALIGN | CBRS_BORDER_ANY);
		nStyle |= (/*CBRS_SIZE_FIXED | */CBRS_TOOLTIPS | CBRS_FLYBY);
		SetBarStyle(nStyle);

		SetOwner(parent);
		GetToolBarCtrl().SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);

		// colour drop buttons
		int nIndex = CommandToIndex(ID_EDIT_BACKCOLOR);
		SetButtonStyle(nIndex, GetButtonStyle(nIndex) | TBSTYLE_DROPDOWN);

		nIndex = CommandToIndex(ID_EDIT_TEXTCOLOR);
		SetButtonStyle(nIndex, GetButtonStyle(nIndex) | TBSTYLE_DROPDOWN);

		/////////////////////////////////////
		// Map in combo boxes
		//

		TBBUTTON buttons[] = 
		{
			{ 0, FONT_NAME_ID, 0, TBSTYLE_SEP, 0, NULL },
			{ 0, -1, 0, TBSTYLE_SEP, 0, NULL },
			{ 0, FONT_SIZE_ID, 0, TBSTYLE_SEP, 0, NULL },
			{ 0, -1, 0, TBSTYLE_SEP, 0, NULL },
		};
		const int BTNCOUNT = sizeof(buttons) / sizeof(TBBUTTON);

		for (int nBtn = 0; nBtn < BTNCOUNT; nBtn++)
			GetToolBarCtrl().InsertButton(nBtn, &buttons[nBtn]);

		CRect rect;

		TBBUTTONINFO tbi;
		tbi.cbSize = sizeof(TBBUTTONINFO);
		tbi.cx = FONT_COMBO_WIDTH;
		tbi.dwMask = TBIF_SIZE;  // By index

		// The font name combo
		GetToolBarCtrl().SetButtonInfo(FONT_NAME_ID, &tbi);
		GetItemRect(FONT_NAME_POS, &rect);

		rect.left++;
		rect.top++;		
		rect.bottom += COMBO_HEIGHT;

		if (!m_font.Create(WS_CHILD | WS_VSCROLL |	WS_VISIBLE | CBS_AUTOHSCROLL | 
							CBS_DROPDOWNLIST | CBS_SORT, rect, this, DROPDOWN_FONT))
			return FALSE;

		m_font.SetFont(CFont::FromHandle((HFONT) ::GetStockObject(DEFAULT_GUI_FONT)));
		m_font.FillCombo();

		// The font size combo
		tbi.cx = COMBO_WIDTH;
		GetToolBarCtrl().SetButtonInfo(FONT_SIZE_ID, &tbi);
		GetItemRect(FONT_SIZE_POS, &rect);

		rect.top++;		
		rect.bottom += COMBO_HEIGHT;
		
		if (!m_size.Create(WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | 
							CBS_HASSTRINGS, rect, this, DROPDOWN_SIZE))
			return FALSE;

		m_size.SetFont(CFont::FromHandle((HFONT) ::GetStockObject(DEFAULT_GUI_FONT)));
		m_size.FillCombo();

		SetBorders(4, 4, 0, 0);

		return TRUE;
	}
	
	return FALSE;
}
예제 #18
0
LRESULT CSearchParamsWnd::OnInitDialog(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	Default();
	InitWindowStyles(this);

	//(void)m_sizeDefault; // not yet set
	CRect sizeDefault;
	GetWindowRect(&sizeDefault);
	CRect rcBorders(4, 4, 4, 4);
	SetBorders(&rcBorders);
	m_szFloat.cx = sizeDefault.Width() + rcBorders.left + rcBorders.right + GetSystemMetrics(SM_CXEDGE) * 2;
	m_szFloat.cy = sizeDefault.Height() + rcBorders.top + rcBorders.bottom + GetSystemMetrics(SM_CYEDGE) * 2;
	m_szMRU = m_szFloat;

	UpdateData(FALSE);
	SetAllIcons();

	GetDlgItem(IDC_MSTATIC3)->GetWindowRect(&m_rcNameLbl);
	ScreenToClient(&m_rcNameLbl);

	m_ctlName.GetWindowRect(&m_rcName);
	ScreenToClient(&m_rcName);

	GetDlgItem(IDC_DD)->GetWindowRect(&m_rcDropDownArrow);
	ScreenToClient(&m_rcDropDownArrow);

	GetDlgItem(IDC_MSTATIC7)->GetWindowRect(&m_rcFileTypeLbl);
	ScreenToClient(&m_rcFileTypeLbl);

	m_ctlFileType.GetWindowRect(&m_rcFileType);
	ScreenToClient(&m_rcFileType);

	GetDlgItem(IDC_SEARCH_RESET)->GetWindowRect(&m_rcReset);
	ScreenToClient(&m_rcReset);

	GetDlgItem(IDC_METH)->GetWindowRect(&m_rcMethodLbl);
	ScreenToClient(&m_rcMethodLbl);

	m_ctlMethod.GetWindowRect(&m_rcMethod);
	ScreenToClient(&m_rcMethod);

	m_ctlOpts.GetWindowRect(&m_rcOpts);
	ScreenToClient(&m_rcOpts);

	m_ctlStart.GetWindowRect(&m_rcStart);
	ScreenToClient(&m_rcStart);
	
	m_ctlMore.GetWindowRect(&m_rcMore);
	ScreenToClient(&m_rcMore);
	
	m_ctlCancel.GetWindowRect(&m_rcCancel);
	ScreenToClient(&m_rcCancel);

	if (thePrefs.GetUseAutocompletion())
	{
		m_pacSearchString = new CCustomAutoComplete();
		m_pacSearchString->AddRef();
		if (m_pacSearchString->Bind(m_ctlName, ACO_UPDOWNKEYDROPSLIST | ACO_AUTOSUGGEST))
			m_pacSearchString->LoadList(thePrefs.GetMuleDirectory(EMULE_CONFIGDIR) + SEARCH_STRINGS_PROFILE);
		if (theApp.m_fontSymbol.m_hObject)
		{
			GetDlgItem(IDC_DD)->SetFont(&theApp.m_fontSymbol);
			GetDlgItem(IDC_DD)->SetWindowText(_T("6")); // show a down-arrow
		}
	}
	else
		GetDlgItem(IDC_DD)->ShowWindow(SW_HIDE);

	m_ctlName.LimitText(MAX_SEARCH_EXPRESSION_LEN); // max. length of search expression
	
	m_ctlMethod.ModifyStyle(0, WS_CLIPCHILDREN); // Reduce flickering during resize
	InitMethodsCtrl();
	if (m_ctlMethod.SetCurSel(thePrefs.GetSearchMethod()) == CB_ERR)
		m_ctlMethod.SetCurSel(SearchTypeEd2kServer);

	m_ctlFileType.ModifyStyle(0, WS_CLIPCHILDREN); // Reduce flickering during resize
	m_ctlFileType.GetComboBoxCtrl()->ModifyStyle(0, CBS_SORT);
	InitFileTypesCtrl();
	// Win98: "CComboBoxEx2::SelectString" fails under Win98!
	//if (!m_ctlFileType.SelectString(GetResString(IDS_SEARCH_ANY)))
	//	m_ctlFileType.SetCurSel(0);
	if (!m_ctlFileType.SelectItemDataStringA(ED2KFTSTR_ANY))
		m_ctlFileType.SetCurSel(0);

	m_ctlOpts.ModifyStyle(0, WS_CLIPCHILDREN); // Does not help, control keeps flickering like mad
	m_ctlOpts.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_LABELTIP);
	m_ctlOpts.InsertColumn(0, GetResString(IDS_PARAMETER));
	m_ctlOpts.InsertColumn(1, GetResString(IDS_VALUE));

	m_ctlOpts.InsertItem(orMinSize, GetResString(IDS_SEARCHMINSIZE));
	m_ctlOpts.InsertItem(orMaxSize, GetResString(IDS_SEARCHMAXSIZE));
	m_ctlOpts.InsertItem(orAvailability, GetResString(IDS_SEARCHAVAIL));
	m_ctlOpts.InsertItem(orExtension, GetResString(IDS_SEARCHEXTENTION));
	m_ctlOpts.InsertItem(orCompleteSources, GetResString(IDS_COMPLSOURCES));
	m_ctlOpts.InsertItem(orCodec, GetResString(IDS_CODEC));
	m_ctlOpts.InsertItem(orBitrate, GetResString(IDS_MINBITRATE));
	m_ctlOpts.InsertItem(orLength, GetResString(IDS_MINLENGTH));
	m_ctlOpts.InsertItem(orTitle, GetResString(IDS_TITLE));
	m_ctlOpts.InsertItem(orAlbum, GetResString(IDS_ALBUM));
	m_ctlOpts.InsertItem(orArtist, GetResString(IDS_ARTIST));
	m_ctlOpts.SetColumnWidth(0, 100/*LVSCW_AUTOSIZE*/);
	m_ctlOpts.SetColumnWidth(1, 120);

	UpdateControls();
	OnEnChangeName();

	return TRUE;
}