Official eMule-Board: Minor Bugfix For Filtertext On Language Change - Official eMule-Board

Jump to content


Page 1 of 1

Minor Bugfix For Filtertext On Language Change

#1 User is offline   JvA 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 160
  • Joined: 16-July 05

Post icon  Posted 11 September 2008 - 01:33 AM

- the following changes fix a bug which was introduced when sharedfiles filter was added.
on changing the language the text of the filter isn't updated with the new string. the new language string only appears by clicking into the filter field.
the following changes will fix the problem.


void CSharedFilesWnd::Localize()
{
	sharedfilesctrl.Localize();
	m_ctlSharedDirTree.Localize();
	m_ctlFilter.ShowColumnText(true); // JvA - Update FilterText on Language change fix
	sharedfilesctrl.SetDirectoryFilter(NULL,true);
...


EditDelayed.h
public:
	  ...
	   // when not using pColumnHeader this text will be shown when the control is empty and has no focus
		  void	SetAlternateText(const CString& rstrText)	{ m_strAlternateText = rstrText; }
		  void	ShowColumnText(bool bShow); // JvA - Update FilterText on Language change fix
	  ...
	  protected:
	  ...
		  void	DoDelayedEvalute(bool bForce = false);
		  void	SetEditRect(bool bUpdateResetButtonPos, bool bUpdateColumnButton = false);
		  // void	ShowColumnText(bool bShow); // JvA - Update FilterText on Language change fix
	  ...


thats it.
thanks for your attention.

JvA

edit: after a quick correspondence with stulle and some more testing i've shrinked the code and added the fix for the searchresultsfilter too.

this is the fix for the searchresultswnd:
void CSearchResultsWnd::Localize()
{
	searchlistctrl.Localize();
	m_ctlFilter.ShowColumnText(true); // JvA - Update FilterText on Language change fix
	UpdateCatTabs();
...


i think this is much better.

JvA

This post has been edited by JvA: 11 September 2008 - 08:21 AM

0

#2 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Post icon  Posted 12 September 2008 - 06:53 AM

This bug didn't appear on my system and I had to search for it until I noticed I had already "fixed" it in a different way which I am willing to share...
Instead of using a separate headercontrol I simply attach the current header which fixes the issue because it always pics the proper strings then.

SharedFilesWnd.h:

Quote

//CHeaderCtrl m_ctlSharedListHeader; //remove


SharedFilesWnd.h:

Quote

// m_ctlSharedListHeader.Attach(sharedfilesctrl.GetHeaderCtrl()->Detach()); //remove
CArray<int, int> aIgnore; // ignored no-text columns for filter edit
aIgnore.Add(8); // shared parts
aIgnore.Add(11); // shared ed2k/kad
// m_ctlFilter.OnInit(&m_ctlSharedListHeader, &aIgnore);
m_ctlFilter.OnInit(sharedfilesctrl.GetHeaderCtrl(), &aIgnore);


SearchResultsWnd.h:

Quote

// CHeaderCtrl m_ctlSearchListHeader; //remove


SearchResultsWnd.cpp:

Quote

// m_ctlFilter.OnInit(&m_ctlSearchListHeader); //remove
m_ctlFilter.OnInit(searchlistctrl.GetHeaderCtrl());

0

#3 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 508
  • Joined: 22-November 04

Posted 12 September 2008 - 02:27 PM

WiZaRd, how should we change the line where m_ctlSharedListHeader.Detach() called in the destructor of CSharedFilesWnd? I assume it could be

Quote

sharedfilesctrl.GetHeaderCtrl()->Detach();

Am I right?
0

#4 User is offline   moloko+ 

  • ...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1209
  • Joined: 18-August 05

Posted 12 September 2008 - 03:32 PM

I think you can omit the Detach altogether in the d'tor because the Header hasn't been mapped to a member in WiZaRd's fix.
0

#5 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 12 September 2008 - 04:48 PM

Right - remove it - it's not necessary because it's not even attached... I dunno why the devs made it that way in the first place :flowers:
0

#6 User is offline   morph4u 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 147
  • Joined: 10-October 08

Posted 28 October 2008 - 11:58 AM

Hi !
After adding this fix you cant open filter select menu. (sharedfiles and searchresultwnd)
I see this bug also in X-Ray v1.6 and ml's ZZUL Plus.
Greetz...
0

#7 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 28 October 2008 - 12:01 PM

It works in my mod and with my fix so I think something was changed incorrectly.
0

#8 User is offline   JvA 

  • Splendid Member
  • PipPipPipPip
  • Group: Members
  • Posts: 160
  • Joined: 16-July 05

Posted 28 October 2008 - 12:47 PM

please recheck if there are some more changes....i've checked the codechanges and it seems that there isn't any difference to the posted changes.
thanks in advance....
0

#9 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 28 October 2008 - 01:39 PM

Hm... on the first glance I couldn't find any changes though my code differs a hell of a lot from the official so it might be hidden somewhere... maybe I'll try a merge into some "clean" code when I find some time...
0

#10 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 03 November 2008 - 05:20 PM

Alright, obviously it doesn't work with the headers because they aren't "static" (which they are in my mod because I use some skinned controls) so the solution would be to change the Init and pass the corresponding listctrl as a pointer, declare a CMuleListCtrl member variable and access its headerctrl when needed.
Regards,
WiZ
0

#11 User is offline   tHeWiZaRdOfDoS 

  • Man, what a bunch of jokers...
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 5630
  • Joined: 28-December 02

Posted 11 November 2008 - 12:58 PM

I had some additional time, so...

Quote

class CEditDelayed : public CEdit
{
public:
CEditDelayed();

//>>> WiZaRd
void OnInit(CMuleListCtrl* pParent, CArray<int, int>* paIgnoredColums = NULL);
// void OnInit(CHeaderCtrl* pColumnHeader, CArray<int, int>* paIgnoredColums = NULL);
//<<< WiZaRd
...
//>>> WiZaRd
CMuleListCtrl* m_Parent;
// CHeaderCtrl* m_pctrlColumnHeader;
//<<< WiZaRd
...



Quote

#include "MuleListCtrl.h" //>>> WiZaRd
...
//>>> WiZaRd
void CEditDelayed::OnInit(CMuleListCtrl* pParent, CArray<int, int>* paIgnoredColums)
//void CEditDelayed::OnInit(CHeaderCtrl* pColumnHeader, CArray<int, int>* paIgnoredColums)
//<<< WiZaRd
{
SetEditRect(false);
CRect rectWindow;
GetClientRect(rectWindow);

//>>> WiZaRd
// m_pctrlColumnHeader = pColumnHeader;
m_Parent = pParent;
//<<< WiZaRd
m_hCursor = LoadCursor(NULL, IDC_ARROW);
m_nCurrentColumnIdx = 0;

CImageList* pImageList = new CImageList();
pImageList->Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1);
pImageList->SetBkColor(CLR_NONE);
//>>> WiZaRd
// if (pColumnHeader != NULL)
if(m_Parent != NULL)
//<<< WiZaRd
pImageList->Add(CTempIconloader(_T("SEARCHEDIT")));
else
pImageList->Add(CTempIconloader(_T("KADNODESEARCH")));
...
//>>> WiZaRd
if(m_Parent != NULL)
// if (m_pctrlColumnHeader != NULL)
//<<< WiZaRd
{
if (point.x <= ICON_LEFTSPACE)
{
CHeaderCtrl* m_pctrlColumnHeader = m_Parent->GetHeaderCtrl(); //>>> WiZaRd
...
//>>> WiZaRd
if (m_Parent != NULL)
// if (m_pctrlColumnHeader != NULL)
//<<< WiZaRd
{
CHeaderCtrl* m_pctrlColumnHeader = m_Parent->GetHeaderCtrl(); //>>> WiZaRd
...


Quote

//>>> WiZaRd
// m_ctlFilter.OnInit(&m_ctlSharedListHeader, &aIgnore);
m_ctlFilter.OnInit(&sharedfilesctrl, &aIgnore);
//<<< WiZaRd


Quote

//>>> WiZaRd
// m_ctlFilter.OnInit(&m_ctlSearchListHeader);
m_ctlFilter.OnInit(&searchlistctrl);
//<<< WiZaRd


That's it... have fun...
0

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users