Sigma Php Ajax framework, Ajax Components, GUI Builder
May 24, 2012, 10:53:38 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: misc questions  (Read 365 times)
Bruce_Dickey
Sr. Member
****
Posts: 67


View Profile
« on: September 28, 2011, 03:01:16 PM »

Hi,

More questions...

1. What is meant by “float” in setDockFloat()?

2. Can a label be made to automatically adjust its width (and height) to fit its contents (either when changing the amount of text or changing the font size)? If so, how?

3. How to disable the focus border around various windows so that it is never shown?

4. Is there a method for setting showDirtyMark false for ALL controls?

5. How to create toggle buttons? I.E. not linb setToggleBtn() which according to documentation appears to show/hide the control, but a push button that switches states on alternate clicks and visually switches between appearing “up” and “down”/”pressed”?

6. How to place radio buttons on a horizontal row instead of in a vertical column?

Thanks!
Bruce
Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: September 28, 2011, 06:02:07 PM »

>>1. What is meant by “float” in setDockFloat()?

    A "float" docking ctrl will not affect other docking ctrls' region.

    You can try add a ctrl with dock:top, and a ctrl with dock:fill, and then modify the previous one to dock:float.

>>2. Can a label be made to automatically adjust its width (and height) to fit its contents (either when changing the amount of text or changing the font size)? If so, how?

    You can use SLabel.

                (new linb.UI.SLabel)
                .setHost(host,"ctl_slabel1")
                .setLeft(290)
                .setTop(80)
                .setCaption("ctl_slabel1")

>>3. How to disable the focus border around various windows so that it is never shown?

   No that option in the lib. You can use CSS to disable that. In Chrome?

>>4. Is there a method for setting showDirtyMark false for ALL controls?

    No, you can set class one by one:

    linb.UI.Input.setDataModel({showDirtyMark:{ini:false}});
    linb.UI.ComboInput.setDataModel({showDirtyMark:{ini:false}})
   ....

    Or, add css to html like this:

    .linb-ui-dirty{
       background:none;
    }

>>5. How to create toggle buttons? I.E. not linb setToggleBtn() which according to documentation appears to show/hide the control, but a push button that switches states on alternate clicks and visually switches between appearing “up” and “down”/”pressed”?

    You can use linb.UI.Button ctrl.

                 (new linb.UI.Button)
                .setHost(host,"ctl_button5")
                .setLeft(70)
                .setTop(150)
                .setCaption("ctl_button5")
                .setType("status")

>>6. How to place radio buttons on a horizontal row instead of in a vertical column?

    Increase the width of the ctrl
Logged
Bruce_Dickey
Sr. Member
****
Posts: 67


View Profile
« Reply #2 on: September 29, 2011, 01:04:40 PM »

Thank you very much.

I still have a question on #5 -- I know how to make a button, as you indicated:

      (new linb.UI.Button)
      .setHost(host,"ctl_button5")
      .setLeft(70)
      .setTop(150)
      .setCaption("ctl_button5")
      .setType("status")

... but not how to make it a toggle button.  Looking online, I see techniques such as

   <html>
   <head>
   <style type="text/css">
   .on {
   border:1px outset;
   color:#369;
   background:#efefef;
   }

   .off {
   border:1px outset;
   color:#369;
   background:#f9d543;
   }
   </style>

   <script language="javascript">
   function togglestyle(el){
       if(el.className == "on") {
           el.className="off";
       } else {
           el.className="on";
       }
   }
   </script>
   </head>

   <body>
      <input type="button" id="btn" value="button" class="off" onclick="togglestyle(this)" />
   </body>
   </html>

and other similar techniques at http://stackoverflow.com/questions/309081/how-do-you-create-a-toggle-button, etc.

My question is whether LINB has a more concise way to achieve the same effect, possibly as a setCustomStyle() call, or as something like

      (new linb.UI.Button)
       .setToggleStyle(true)

or
      (new linb.UI.CheckBox)
      .setPushputtonStyle(true)    //  Make it look like a push button

or
      (new linb.UI.RadioBox)
      .setPushputtonStyle(true)    //  Make it look like a push button

Thanks,
Bruce






Logged
linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #3 on: September 29, 2011, 06:00:22 PM »

      (new linb.UI.Button)
      .setHost(host,"ctl_button5")
      .setLeft(70)
      .setTop(150)
      .setCaption("ctl_button5")
      .setType("status")
      .setValue(false)
Logged
Bruce_Dickey
Sr. Member
****
Posts: 67


View Profile
« Reply #4 on: September 30, 2011, 07:24:58 AM »

Great -- thanks for your patience - I didn't see it the first time!
« Last Edit: September 30, 2011, 07:59:24 AM by Bruce_Dickey » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!