ComboBox and PopupMenu Customization using HTML Text required

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #70526
    Support
    Keymaster

      Hello! Could you upload a full project, please?

      #70556
      Koushik Halder
      Participant

        Please find attached herewith my project. My sComboBox1 items will be as follows:
        A. Fox
        B. Tiger
        C. Elephant
        Any how I have coded my requirement in sComboBox1 but unable to get my required result as I mentioned above. Please help to rectify.

        But no option for HTML Coded PopupMenu Items. So you are requested to design your own PopupMenu.

        Attachments:
        You must be logged in to view attached files.
        #70574
        Support
        Keymaster

          Thank you.
          Try this code in the OnGetItemDrawData:

          procedure TForm1.sComboBox1GetItemDrawData(Sender: TObject; var ItemDrawData: TacItemDrawData);
          begin
            ItemDrawData.HtmlText := ItemDrawData.Text; // Copy text for a current Item
            ItemDrawData.Text := ''; // Use HtmlText
          end;

          This event is called for an each Item and text should be different for each Item.
          By the way, ‘Cyan’ color is not handled. Main 16 colors are added for parsing.
          You can use a number format for colors there.

          #70576
          Koushik Halder
          Participant

            Thanks for your code. Now sComboBox works perfectly. But PopupMenu Items customization remaining. Please launch your own PopupMenu.

            #70589
            Koushik Halder
            Participant

              Now another problem has come to me. When I am selecting any item in ComboBox it shows HTML Coded Text for example for sComboBox1.Items[0] it shows <b><font color=Yellow>A.</font></b><font color=Red> Fox</font> instead of A. Fox[/color]. But your ComboBox Demo is OK. I am trying to find it out what you have coded more but unable to find. Please mention.

              #70601
              Support
              Keymaster

                Maybe you can upload another demo?

                #70602
                Koushik Halder
                Participant

                  Please find my project attached herewith.

                  Attachments:
                  You must be logged in to view attached files.
                  #70612
                  Koushik Halder
                  Participant

                    I have updated my project.

                    Attachments:
                    You must be logged in to view attached files.
                    #70615
                    Support
                    Keymaster

                      Thank you, I’ll check it soon.

                      #70661
                      Koushik Halder
                      Participant

                        Please do the needful.

                        #70671
                        Support
                        Keymaster

                          Look, the Text property receives html tags from the Items list, when selected.
                          We should think how to avoid this standard behavior…
                          Maybe new property like ‘MakeTextPlain’ will help?

                          #70678
                          Koushik Halder
                          Participant

                            Yes! Please implement it.

                            #70694
                            Koushik Halder
                            Participant

                              Thank you! I have checked and it is working fine.

                              #70701
                              Koushik Halder
                              Participant

                                MakeTextPlainis working partially. If any ComboBox ItemIndex is other than -1 i.e any item is selected then if I click any component like Button, Editand Memoetc. then selected Item of ComboBoxagain becomes HTML RAW DATA not the plain text.

                                #70707
                                Support
                                Keymaster

                                  Hi! I will check it.

                                Viewing 15 posts - 1 through 15 (of 15 total)
                                • You must be logged in to reply to this topic.