FoxInCloud
button class
Gravatar is a globally recognized avatar based on your email address. button class
  Vincent H.
  All
  Nov 3, 2023 @ 03:27am

Hi Thierry,

By default, buttons include the "btn-outline-secondary" class

If I want to change, for example: "btn-outline-light", I add this instruction in wCSSclassAdd.

This works, but the class is overloaded like this:

Gravatar is a globally recognized avatar based on your email address. re: button class
  FoxInCloud Support - Thierry N.
  Vincent H.
  Nov 4, 2023 @ 12:45am

Hi Vincent,

What the VFP BaseClass of your 'button'? Commandbutton or Image?

Gravatar is a globally recognized avatar based on your email address. re: button class
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 4, 2023 @ 01:49am

Hi Thierry,

Commandbutton

Gravatar is a globally recognized avatar based on your email address. re: button class
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 4, 2023 @ 02:07am

For memory, there is this code in commandbutton.Init()

if wlWeb()
	store 4 to this.PictureMargin, this.PictureSpacing
*!*		if File(ForceExt(this.Picture, CPNG))
*!*			this.Picture = ForceExt(this.Picture, CPNG)
*!*		endif
*!*		if File(ForceExt(this.DisabledPicture, CPNG))
*!*			this.DisabledPicture = ForceExt(this.DisabledPicture, CPNG)
*!*		endif
*!*		if File(ForceExt(this.DownPicture, CPNG))
*!*			this.DownPicture = ForceExt(this.DownPicture, CPNG)
*!*		endif
	if Type('thisForm.wBSlHTMLgen') == 'L' and thisForm.wBSlHTMLgen
		this.wCSSclassAdd = cListEdit(this.wCSSclassAdd;
			, c2Words(Iif(.F.;
				or 'btn-secondary' $ this.wCSSclassAdd;
				or 'btn-primary' $ this.wCSSclassAdd;
				or 'btn-success' $ this.wCSSclassAdd;
				or 'btn-info' $ this.wCSSclassAdd;
				or 'btn-warning' $ this.wCSSclassAdd;
				or 'btn-danger' $ this.wCSSclassAdd;
				or 'btn-link' $ this.wCSSclassAdd;
				, '';
				, 'btn-secondary';
				);
				, ' ';
				, ''; && doo-btn-responsive && 2016-12-23 thn -- {FiC V 2.23.1-beta.1} {en} removed
				);
			, ;
			, ' ';
			)
	endif
endif

return DoDefault()

Gravatar is a globally recognized avatar based on your email address. re: button class
  FoxInCloud Support - Thierry N.
  Vincent H.
  Nov 4, 2023 @ 05:57am

FoxInCloud does not force this CSS class… perhaps somewhere in your code?

Gravatar is a globally recognized avatar based on your email address. re: button class
  FoxInCloud Support - Thierry N.
  Vincent H.
  Nov 4, 2023 @ 06:42am

Vincent,

For memory, there is this code in commandbutton.Init()

Does not seem to execute as btn-secondary is not in your <button class="…"…>, or is modified by a child class' .Init()

Gravatar is a globally recognized avatar based on your email address. re: button class
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 4, 2023 @ 10:49pm

In the posted example, I'm using the commandbutton base class.

Sorry, but I don't see where I could have added code...

Gravatar is a globally recognized avatar based on your email address. re: button class
  Vincent H.
  FoxInCloud Support - Thierry N.
  Nov 4, 2023 @ 11:19pm

I found the culprit:

In xxxServer.prg I have this code:

* ===========================================
DEFINE CLASS xxxHTMLgen as awHTMLgen of awHTML.prg

* ----------------------------------------------------
protected function getHTML_cnt && {fr} HTML par défaut d'un objet contenant
lparameters tlInnerHTML && [.F.] {fr} Rendre l'intérieur du conteneur seulement {en} Render contained objects only

LOCAL lcResult as String

lcResult = DoDefault(m.tlInnerHTML)
return Iif(m.this.cBaseClass == 'form' and m.this.BSlHTMLgen, Strtran(m.lcResult, 'btn-secondary', 'btn-outline-secondary'), m.lcResult)
endfunc

ENDDEFINE  && class snoHTMLgen
* ===========================================

Gravatar is a globally recognized avatar based on your email address. re: button class
  Vincent H.
  Vincent H.
  Nov 5, 2023 @ 06:16am

Yet with this addition in awHTML.prg, "btn-secondary" (replaced by "btn-outline-secondary" in xxxServer.prg) should not be added in the button code

or 'btn-outline-' $ m.lcResult; && 2021-11-04 thn -- {FiC V 3.0.0-beta.5} {en} added

Gravatar is a globally recognized avatar based on your email address. re: button class
  FoxInCloud Support - Thierry N.
  Vincent H.
  Nov 6, 2023 @ 01:23am

a side case probably motivated this code; may now be viewed differently…

© 1996-2024