[GH-ISSUE #630] how to use labelPlacement? #527

Open
opened 2026-02-28 01:25:43 +03:00 by kerem · 13 comments
Owner

Originally created by @ideaChenGo on GitHub (Jun 22, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/630

WiFiManagerParameter(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom, int labelPlacement);

I don't know how to use labelPlacement,
Can you help me please?
Anyway, thanks

Originally created by @ideaChenGo on GitHub (Jun 22, 2018). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/630 WiFiManagerParameter(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom, int labelPlacement); I don't know how to use labelPlacement,\ Can you help me please? Anyway, thanks
Author
Owner

@tablatronix commented on GitHub (Jun 23, 2018):

WFM_LABEL_BEFORE
WFM_LABEL_AFTER
WFM_NO_LABEL

default if empty is before

<!-- gh-comment-id:399616844 --> @tablatronix commented on GitHub (Jun 23, 2018): `WFM_LABEL_BEFORE` `WFM_LABEL_AFTER` `WFM_NO_LABEL` default if empty is before
Author
Owner

@dontsovcmc commented on GitHub (Jun 28, 2018):

We couldn’t find any code matching 'WFM_LABEL_BEFORE' in tzapu/WiFiManager

<!-- gh-comment-id:401014345 --> @dontsovcmc commented on GitHub (Jun 28, 2018): We couldn’t find any code matching 'WFM_LABEL_BEFORE' in tzapu/WiFiManager
Author
Owner

@tablatronix commented on GitHub (Jun 28, 2018):

Development branch

<!-- gh-comment-id:401036355 --> @tablatronix commented on GitHub (Jun 28, 2018): Development branch
Author
Owner

@dontsovcmc commented on GitHub (Jun 28, 2018):

oh.. thanks. Do you know new release date?
Maybe you should fork repository and make your own releases? Sorry, I don't know, why author stopped releasing since 2016.

<!-- gh-comment-id:401068376 --> @dontsovcmc commented on GitHub (Jun 28, 2018): oh.. thanks. Do you know new release date? Maybe you should fork repository and make your own releases? Sorry, I don't know, why author stopped releasing since 2016.
Author
Owner

@tablatronix commented on GitHub (Jun 28, 2018):

development branch is actively updated.. Alpha should be soon

<!-- gh-comment-id:401069401 --> @tablatronix commented on GitHub (Jun 28, 2018): development branch is actively updated.. Alpha should be soon
Author
Owner

@dontsovcmc commented on GitHub (Jul 6, 2018):

@tablatronix remove init function without labelPlacement from header as no used:

void init(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom);

I can create pull request, if needed.

offtopic:
I use custom parameters in my project. Maybe it's better to add them somewhere?

class IPAddressParameter : public WiFiManagerParameter {
public:

    IPAddressParameter(const char *id, const char *placeholder, IPAddress address)
        : WiFiManagerParameter("")
    {
        init(id, placeholder, address.toString().c_str(), 16, "");
    }

    IPAddress getValue() {
        IPAddress ip;
        ip.fromString(WiFiManagerParameter::getValue());
        return ip;
    }
};

class LongParameter : public WiFiManagerParameter {
public:

    LongParameter(const char *id, const char *placeholder, long value, const uint8_t length = 10)
        : WiFiManagerParameter("") {

        init(id, placeholder, String(value).c_str(), length, "");
    }

    long getValue() {
        return String(WiFiManagerParameter::getValue()).toInt();
    }
};

class FloatParameter : public WiFiManagerParameter {
public:

    FloatParameter(const char *id, const char *placeholder, float value, const uint8_t length = 10)
        : WiFiManagerParameter("") {
            
        init(id, placeholder, String(value).c_str(), length, "");
    }

    float getValue() {
        return String(WiFiManagerParameter::getValue()).toFloat();
    }
};
<!-- gh-comment-id:403123777 --> @dontsovcmc commented on GitHub (Jul 6, 2018): @tablatronix remove init function without labelPlacement from header as no used: ```C++ void init(const char *id, const char *placeholder, const char *defaultValue, int length, const char *custom); ``` I can create pull request, if needed. offtopic: I use custom parameters in my project. Maybe it's better to add them somewhere? ```C++ class IPAddressParameter : public WiFiManagerParameter { public: IPAddressParameter(const char *id, const char *placeholder, IPAddress address) : WiFiManagerParameter("") { init(id, placeholder, address.toString().c_str(), 16, ""); } IPAddress getValue() { IPAddress ip; ip.fromString(WiFiManagerParameter::getValue()); return ip; } }; class LongParameter : public WiFiManagerParameter { public: LongParameter(const char *id, const char *placeholder, long value, const uint8_t length = 10) : WiFiManagerParameter("") { init(id, placeholder, String(value).c_str(), length, ""); } long getValue() { return String(WiFiManagerParameter::getValue()).toInt(); } }; class FloatParameter : public WiFiManagerParameter { public: FloatParameter(const char *id, const char *placeholder, float value, const uint8_t length = 10) : WiFiManagerParameter("") { init(id, placeholder, String(value).c_str(), length, ""); } float getValue() { return String(WiFiManagerParameter::getValue()).toFloat(); } }; ```
Author
Owner

@fthiebolt commented on GitHub (Nov 16, 2018):

Hello,

I have had used Ken Taylor version for some time but since dev. branch also features add on parameters, i'm switching back ... with issues:

const char _customHtml_checkbox[]         = "type=\"checkbox\"";
WiFiManagerParameter p_sandbox("sandbox", "neOCampus sandbox", "T", 2, _customHtml_checkbox, WFM_LABEL_AFTER);

but there's a misalignment as you can see in attached picture ... we want to have both checkbox + LMabel on same line ... my mistake ??

screenshot_20181116-115933

Thanks
François

<!-- gh-comment-id:439361587 --> @fthiebolt commented on GitHub (Nov 16, 2018): Hello, I have had used Ken Taylor version for some time but since dev. branch also features add on parameters, i'm switching back ... with issues: ```C++ const char _customHtml_checkbox[] = "type=\"checkbox\""; WiFiManagerParameter p_sandbox("sandbox", "neOCampus sandbox", "T", 2, _customHtml_checkbox, WFM_LABEL_AFTER); ``` but there's a misalignment as you can see in attached picture ... we want to have both checkbox + LMabel on same line ... my mistake ?? ![screenshot_20181116-115933](https://user-images.githubusercontent.com/17379995/48617881-e66c7080-e997-11e8-98bd-7b5b88d7a2a6.jpg) Thanks François
Author
Owner

@tablatronix commented on GitHub (Nov 16, 2018):

hmm Ill take a look

<!-- gh-comment-id:439437291 --> @tablatronix commented on GitHub (Nov 16, 2018): hmm Ill take a look
Author
Owner

@Blueforcer commented on GitHub (Aug 14, 2019):

Any news about the misalignment?

<!-- gh-comment-id:521210457 --> @Blueforcer commented on GitHub (Aug 14, 2019): Any news about the misalignment?
Author
Owner

@tablatronix commented on GitHub (Aug 14, 2019):

I have not looked, sorry forgot about this. Will take a look now

<!-- gh-comment-id:521324804 --> @tablatronix commented on GitHub (Aug 14, 2019): I have not looked, sorry forgot about this. Will take a look now
Author
Owner

@tablatronix commented on GitHub (Aug 14, 2019):

Might be an android thing??
Iphone
41C4C410-A8E0-4889-8746-107C36C9AB9B

<!-- gh-comment-id:521366176 --> @tablatronix commented on GitHub (Aug 14, 2019): Might be an android thing?? Iphone ![41C4C410-A8E0-4889-8746-107C36C9AB9B](https://user-images.githubusercontent.com/807787/63046604-6e849580-be98-11e9-9cc2-189c10e7bb7e.png)
Author
Owner

@Blueforcer commented on GitHub (Aug 21, 2019):

its similar to android, shouldnt be the checkbox in one line with the text? In your screenshot the checkbox is also above the text

<!-- gh-comment-id:523600109 --> @Blueforcer commented on GitHub (Aug 21, 2019): its similar to android, shouldnt be the checkbox in one line with the text? In your screenshot the checkbox is also above the text
Author
Owner

@tablatronix commented on GitHub (Aug 21, 2019):

Shrug then you have more space for chars without wrapping or adding word break rules. Styling checkboxes is a pita, this should be using default browser styles, feel free to make css suggestions..

<!-- gh-comment-id:523678906 --> @tablatronix commented on GitHub (Aug 21, 2019): Shrug then you have more space for chars without wrapping or adding word break rules. Styling checkboxes is a pita, this should be using default browser styles, feel free to make css suggestions..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#527
No description provided.