Profile Picture

NFileLookup and NComboBox don't use the application palette

Posted By Craig Swearingen 12 Years Ago

NFileLookup and NComboBox don't use the application palette

Author
Message
Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

On Win7 with the 11.12.14.12 I let the user choose the palette including letting them use

NUIManager.Palette.Scheme = ColorScheme.Longhorn;

Darker palettes are more popular in applications these days and when widgets don't completely use the palette its quite obvious in them.

1) I recently added function that uses the NFileLookup widget and noticed that it doesn't completely use the palette background color.  Its always got a white background.  You can easily reproduce this in the Nevron UI C# Examples program by changing the palette while showing the "File Look-up" page in the application you provide.

2) The NComboBox does support the palette in use except for the list used by the auto-complete feature.  My NComboBox with auto-complete is coded like this:

cbSymbol.Items.AddRange(mylist);

cbSymbol.EditControl.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;

cbSymbol.EditControl.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;

AutoCompleteStringCollection ac = new AutoCompleteStringCollection();

ac.AddRange(mylist);

cbSymbol.EditControl.AutoCompleteCustomSource = ac;

When the user types and the auto-complete suggestion drop list shows the list is always black text on a white background no matter the palette in use.

For my application issue #2 above is the most important to find a solution for.  I need it to honor the palette in use.  Given your documentation indicates the NComboBox is written from scratch it seems this should be fixable.  Is there someway to access this list widget so I can set the palette?



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hello Craig,

When you press "Browse for file ..." button in NFileLookup control it opens the Windows.System.Forms.OpenFileDialog which cannot be modified by the palette applied on NFileLookup control.

The case with NComboBox is similar. When NComboBox.Editable is true EditControl is a Windows.System.Forms.TextBox control.

Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

1) I'm not referring to the file lookup dialog.  I'm referring to the NFileLookup widget itself.  I've attached a picture.  Notice the white background in the text portion of the widget.  It should be a bluish color.

2) Thanks for explaining.  (I guess the NComboBox isn't "written entirely by scratch" then.  :-) )



Attachments
Capture.GIF (318 views, 19.00 KB)
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hello Craig,

The text portion of the NFileLookup is a TextBox control.
You cannot apply the selected palette on it, but I can suggest a workaround:

TextBox textBox = nFileLookup1.Controls[0] as TextBox;
if (textBox != null)
{
   textBox.BackColor = nFileLookup1.Palette.Control;
   textBox.ForeColor = nFileLookup1.Palette.ControlText;
}

I hope this helps.

Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

Thanks very much for the suggestion.  I created this NFileLookup subclass which accomplishes what I expected.  I would think something like this should be part of the Nevron toolkit but as long as there is a work around I'm good to go.

public class ctrlExNFileLookup : NFileLookup

{

public ctrlExNFileLookup()

{

setTextColors();

NUIManager.GlobalPaletteChange += new EventHandler(NUIManager_GlobalPaletteChange);

this.Disposed += new EventHandler(ctrlExNFileLookup_Disposed);

}

private void ctrlExNFileLookup_Disposed(object sender, EventArgs e)

{

NUIManager.GlobalPaletteChange -= new EventHandler(NUIManager_GlobalPaletteChange);

}

private void NUIManager_GlobalPaletteChange(object sender, EventArgs e)

{

setTextColors();

}

private void setTextColors()

{

if (Controls.Count > 0)

{

TextBox textBox = Controls[0] as TextBox;

if (textBox != null)

{

textBox.BackColor = NUIManager.Palette.Window;

textBox.ForeColor = NUIManager.Palette.WindowText;

}

}

}

}





Similar Topics


Reading This Topic