Recent

Author Topic: I have a list from songs!  (Read 22632 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: I have a list from songs!
« Reply #15 on: June 04, 2015, 08:47:31 pm »
Why not a RichEdit control? It is the obvious and easiest way.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: I have a list from songs!
« Reply #16 on: June 04, 2015, 08:52:38 pm »
Ну должно получится что этот список грузится из txt или ini файла(((
во типо с такого файла!
Тебе нужна связь между аудио файлами и словами записанными в .txt файле.
Иначе, ты не сможешь сопоставить "звук" с "текст".
Тот .txt файл, который ты загрузил раньше, такой связки не имеет.




Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #17 on: June 04, 2015, 10:33:39 pm »
I want in to output information in listbox! for example the sound sounds, and to me in listbox the Sound, Transkripytion, the Translation is removed! how to achieve it??? if I have txt the file and all (((help please I ask, people kind the project costs can't will move a little (((

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #18 on: June 04, 2015, 10:40:49 pm »
I set an example only, I have txt the file, which connected with sounds as it to remove in Listbox, here an example
sound of "abaut"
transfer to this sound a transcription is written to txt the file at me,
and so on all words, there is a sound opposite at me on the same place under the same number and txt the file is written down I simply ask for help how to bring this list out of file txt in Listbox?? thanks for earlier, I am grateful to all who will help)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: I have a list from songs!
« Reply #19 on: June 04, 2015, 10:42:40 pm »
I simply ask for help how to bring this list out of file txt in Listbox??
Code: [Select]
ListBox1.Items.LoadFromFile( 'filename.txt');

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #20 on: June 04, 2015, 10:44:32 pm »
я показал пример только, у меня есть txt файл который связаный со звуками, как это вывести в Listbox, вот пример
звук "abaut"
в txt файле написан у меня перевод на этот звук транскрипция,
и так на всех словах, стоит звук противоположно у меня на том же месте под тем же числом и записан txt файл я просто прошу помощи как вывести этот список из txt файла в Listbox?? спасибо за ранее, благодарен всем кто поможет)

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #21 on: June 04, 2015, 10:45:36 pm »
Вот это и все??? а как сделать его первая строка синим цветом вторая красным третья зеленым??? что бы в лист боксе выводилась??

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #22 on: June 04, 2015, 10:46:31 pm »
Вопрос еще один на какую кнопку мне этот код пихать???

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #23 on: June 04, 2015, 11:08:42 pm »
где его можно скачать??


sfeinst

  • Sr. Member
  • ****
  • Posts: 258
Re: I have a list from songs!
« Reply #24 on: June 05, 2015, 01:53:43 am »
I am not sure if this is what you want, but if you set your listbox style to lbownerdrawfixed and then in the DrawItemEvent.  You would have code like:

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
   ARect: TRect; State: TOwnerDrawState);
begin
  with (Control as TListBox).Canvas do
  begin
    case Index of
      0: Font.Color := clBlue;
      1: Font.Color := clGreen;
      2: Font.Color := clRed;
      else Font.Color := clBlack;
    end;
    FillRect(ARect);
    TextOut(ARect.Left, ARect.Top, (Control as TListBox).Items[Index]);
  end;
end;

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #25 on: June 05, 2015, 04:47:40 am »
Может это и то что я хотел))) просто проверить не могу, мне выводить надо из txt файла для начала в Listbox а затем уже при выводе текста показывали мне цвета!)))

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #26 on: June 05, 2015, 05:06:46 am »
Мне нужно что бы не так записывался  из txt файл как показано на фото, а так как ниже пример привел на рисунке! и в Listbox что бы был одно слово а не все сразу!
« Last Edit: June 09, 2015, 09:27:59 pm by Neprofi »

sfeinst

  • Sr. Member
  • ****
  • Posts: 258
Re: I have a list from songs!
« Reply #27 on: June 05, 2015, 01:20:08 pm »
I put together a quick app.  It reads a file (with 3 rows) into a TStringList.  I'm not sure how you planned on doing this - all at the beginning like this example would depend on the size of the file - you may not want to read the whole file in if it is very large.  A database might be a better option.  But you were asking about a file.  The last item in each row is different than what you wrote because I could not make the symbols easily.

The form asks for a row.  Enter 1,2 or 3 and click the button.  The TListBox will then populate from the selected row.  In your app, I'm guessing you want to associate the row to display, to some other action, but I am unsure of what action you want and how you are associating that action to a particular row.  But this should get you started.

Neprofi

  • Full Member
  • ***
  • Posts: 174
Re: I have a list from songs!
« Reply #28 on: June 05, 2015, 02:12:31 pm »
а где exe файл))) проверю напишу)))) спасибо  вам))))

sfeinst

  • Sr. Member
  • ****
  • Posts: 258
Re: I have a list from songs!
« Reply #29 on: June 05, 2015, 02:18:33 pm »
To keep upload small, I just included the source code.  You should be able to compile it.  It is the entire project.

 

TinyPortal © 2005-2018