Создание Эльфов : Эльфостроение : Форум

Страница 55 из 211: « 1 ... 51 52 53 54 [55] 56 57 58 59 ... 211 »

 Joker XT:
15.08.08, 18:40
 int text[2];
text[0]=Str2ID (L"HELLO SEBBS",0,100);
text[1]=Str2ID (L"HELLO SEBBS1",0,100);
SetMenuItemText0(msg,TextCopyId(text[item]));

 jamesbond22:
15.08.08, 18:56
 
Код: 
int onLBMessage(GUI_MESSAGE * msg)
{
  MyBOOK * myBook = (MyBOOK *) FindBook(isBook...);
  int item;
  SESSION_ITEM * si;
  switch(msg->msg)
  {
  case 1:
  item=GUIonMessage_GetCreatedItemIndex(msg);
  si=(SESSION_ITEM *)ListElement_GetByIndex(myBook->cfg_list,item);
  int text[1];
  text[0]=Str2ID (L"HELLO SEBBS",0,100);
  SetMenuItemText0(msg,TextCopyId(text[item]));

 }
return(1);
};


int onLBMessage1(GUI_MESSAGE * msg)
{
  MyBOOK * myBook = (MyBOOK *) FindBook(isBook...);
  int item;
  SESSION_ITEM * si;
  switch(msg->msg)
  {
  case 1:
  item=GUIonMessage_GetCreatedItemIndex(msg);
  si=(SESSION_ITEM *)ListElement_GetByIndex(myBook->cfg_list,item);
  int text[2];
  text[0]=Str2ID (L"HELLO SEBBS1",0,100);
  SetMenuItemText0(msg,TextCopyId(text[item]));
 }
return(1);
};

...

  SetNumOfMenuItem(clist,2);
  SetMenuItemStyle(clist,3); 
  int text[2];
  OneOfMany_SetonMessage((GUI_ONEOFMANY*)clist,onLBMessage);
  OneOfMany_SetonMessage((GUI_ONEOFMANY*)clist,onLBMessage1);

this source code is now ok?


"int text[2];" - where this put?


[ Edited by jamesbond22 в 15.8.08 17:02 ]

 Joker XT:
15.08.08, 19:08
 no no no no...

int text[2]; 2 - how much text marks

Код: 
int onLBMessage(GUI_MESSAGE * msg)
{
  int item;
  switch(msg->msg)
  {
  case 1:
  item=GUIonMessage_GetCreatedItemIndex(msg);
  int text[2];
  text[0]=Str2ID (L"HELLO SEBBS",0,100);
  text[1]=Str2ID (L"HELLO SEBBS1",0,100);
  SetMenuItemText0(msg,TextCopyId(text[item]));
 }
return(1);
};

...

  SetNumOfMenuItem(clist,2);
  SetMenuItemStyle(clist,3); 
  OneOfMany_SetonMessage((GUI_ONEOFMANY*)clist,onLBMessage);


 jamesbond22:
15.08.08, 19:19
 Joker XT
mow I understand. Big thanks.

How add actions for pressing in "HELLO SEBBS" and "HELLO SEBBS1"? In example: show message - "jamesbond22".
I must define "void onEnterPressed"?

[ Edited by jamesbond22 в 15.8.08 17:37 ]

 Joker XT:
15.08.08, 19:55
 void onEnterPressed(BOOK * bk,void *)
{
MessageBox(...);
}


Добавлено 15.8.08 21:56

And
AddMSGHook(list_menu,ACTION_SELECT1,onEnterPressed);

 jamesbond22:
15.08.08, 20:10
 Joker XT
my source code:

Код: 
...
void onEnterPressed(BOOK * book,void * lt)
{
  MessageBox (0x6fFFFFFF,STR("jamesbond22"),0,1,5000,0);
};

...

GUIObject_Softkey_SetAction(clist,ACTION_SELECT1,onEnterPressed2);
...


but I press in "HELLO SEBBS" and "HELLO SEBBS1" and I see "jamesbond22". How get 2 difference messages?

press "HELLO SEBBS" - see "jamesbond22"
press "HELLO SEBBS1" - see "jamesbond221"

And how get action to open dir?

[ Edited by jamesbond22 в 15.8.08 18:11 ]

 Joker XT:
15.08.08, 20:17
 void onEnterPressed(BOOK * book,void * lt)
{
int item = GetFocusetListObjectItem(list_menu);
if(item==0)
MessageBox (0x6fFFFFFF,STR("jamesbond22"),0,1,5000,0);
if(item==1)
MessageBox (0x6fFFFFFF,STR("jamesbond221"),0,1,5000,0);
};

 jamesbond22:
15.08.08, 20:25
 Joker XT
I try this , but I get error:

Error[e46]: Undefined external "GetFocusetListObjectItem_FUNCTION_IS_DEPRECATED_USE_ListMenu_GetSelectedItem()" referred in
main ( C:\Documents and Settings\Administrator\Pulpit\Kopia\Release\Obj\main.r79 )

[ Edited by jamesbond22 в 15.8.08 18:34 ]

 den_po:
15.08.08, 20:40
 jamesbond22
don't you see anything in this error message?

 jamesbond22:
15.08.08, 20:42
 "GetFocusetListObjectItem_FUNCTION_IS_DEPRECATED_USE_ListMenu_GetSelectedItem()"

den_po
you think about this?

I change in source code " GetFocusetListObjectItem" -> "ListMenu_GetSelectedItem".

Now is ok. I will remember this tip.



Код: 
void onEnterPressed(BOOK * book,void * lt)
{
  int item = ListMenu_GetSelectedItem(barteklist);  
  if(item==0)
  MessageBox (0x6fFFFFFF,STR("jamesbond22"),0,1,5000,0);
  if(item==1)
  MessageBox (0x6fFFFFFF,STR("jamesbond221"),0,1,5000,0);
};

ok, that can show messages.

How can get open folders?



Код: 
void onEnterPressed(BOOK * book,void * lt)
{
  int item = ListMenu_GetSelectedItem(barteklist);  
  if(item==0)
  (GetDir(DIR_OTHER | MEM_INTERNAL));
  if(item==1)
  (GetDir(DIR_OTHER | MEM_EXTERNAL));
};

that is not ok?


Anybody know how add link to folder or to selected book?

UltraShot
how you add link to folder in your elf ElfManager?


[ Edited by jamesbond22 в 16.8.08 12:43 ]
Страница 55 из 211: « 1 ... 51 52 53 54 [55] 56 57 58 59 ... 211 »

URL этой темы:
https://mobilefree.justdanpo.ru/newbb_plus/viewtopic.php?topic_id=2479&start=540

© 2005-2018 supertrubka.org