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

Страница 186 из 211: « 1 ... 182 183 184 185 [186] 187 188 189 190 ... 211 »

 albertnet3:
07.08.11, 00:01
 
Metaler пишет:
Joker XT, писал:
GUIonMessage_SetMenuItemIcon(msg, item, IMAGEID[item]);

я пробовал так, не катит )
массив вроде правильно сделал wchar_t* img[]={ &imgID_1, &imgID_2 };


GUIonMessage_SetMenuItemIcon( GUI_MESSAGE* msg, int align, IMAGEID )


GUI_MESSAGE* msg - Message of the GUI
int align- 0 left 1- right 2- center
IMAGEID your Id of the icon or set your icon in hex
example:

Код:
GUIonMessage_SetMenuItemIcon( msg,1,0x24D) );




den_po, sorry hehe


[ Edited by albertnet3 в 6.8.11 19:13 ]

 den_po:
07.08.11, 00:42
 albertnet3, GUI_MESSAGE* это НЕ gui

 albertnet3:
07.08.11, 01:24
 den_po, I need your help please ;)
I can not work the function OneOfMany_SetChecked
my gui have 5 items and only show cheked the item 2

please look this code:
Код: 
typedef struct{
  BOOK  book;
  GUI *gui;
  GUI *gui2;
  GUI *Request; 
  int itemID;
  int fileitem;
}MyBOOK;

#define FILE_COUNT 5


typedef struct{
  char item[FILE_COUNT];
}FILE_DATA;

void GetData(void *mydata,int size)
{
  int f;
  wchar_t *path=FILE_PATH;
  wchar_t *name=FILE_NAME;
  f=_fopen(path,name,0x108,0x180,0);
  fread(f,mydata,size);
  fclose(f);
}

void WriteData(int numitem,int itemID)
{
  int f;
  wchar_t *path=FILE_PATH;
  wchar_t *name=FILE_NAME;
  FILE_DATA *fd=(FILE_DATA*)malloc(sizeof(FILE_DATA));
  memset(fd,0xFF,sizeof(FILE_DATA));
  GetData(fd,sizeof(FILE_DATA));
  fd->item[numitem]=itemID;
  f=_fopen(path,name,0x204,0x180,0);
  fwrite(f,fd,sizeof(FILE_DATA));
  fclose(f);
  mfree(fd);
}


void onEnterSetID(BOOK *book,void *r1)
{
  MyBOOK *m_bk = (MyBOOK *)book;
  GUI_ONEOFMANY *om = (GUI_ONEOFMANY *)(m_bk->gui2);
  int item = OneOfMany_GetSelected(om);
  m_bk->itemID=item;
  if (m_bk->itemID == 0)
    {
      action1();
      VA_Restart_On(book);
      vibra();
    }
   if (m_bk->itemID == 1)
    {
      action2();
      VA_Restart_On(book);
      vibra();
    }
   if (m_bk->itemID == 2)
    {
      action3();
      VA_Restart_On(book);
      vibra();
    }
   if (m_bk->itemID == 3)
    {
      action4();
      VA_Restart_On(book);
      vibra();
    }
   if (m_bk->itemID == 4)
    {
      action5();
     VA_Restart_On(book);
     vibra();
    }
  WriteData(m_bk->fileitem,m_bk->itemID);
  FREE_GUI(m_bk->gui2);
}

int CreateEditItem(BOOK *book,int itemnum)
{
  MyBOOK *m_bk = (MyBOOK *)book;
  GUI_ONEOFMANY *om=CreateOneOfMany(&m_bk->book);
...
  OneOfMany_SetChecked(om,m_bk->fileitem);
...
  m_bk->gui2 = (GUI *)om;
  GUIObject_Show(om);
  return(1);
}


 den_po:
07.08.11, 10:44
 albertnet3, don't you realise what does the name of this gui mean?

 albertnet3:
07.08.11, 19:07
 
den_po пишет:
albertnet3, don't you realise what does the name of this gui mean?

thanks for your reply, but the actions of the gui oneofmany works correct.
only I can´t work correctly setcheked,
I think my problem is in writing data and get data.
I wanted to do it thus but I have not been able.
Код: 

            PUSH    {R4,LR}
        ADD    R4, R1,    0
        BL    _SetChecked
        CMP    R1, 0
        BEQ    Estilo1
        CMP    R1, 1
        BEQ    Estilo2
        CMP    R1, 2
        BEQ    Estilo3
        CMP    R1, 3
        BEQ    Estilo4
        CMP    R1, 5
        BEQ    Estilo4
        POP    {R4,PC}
        
Estilo1:    
        BL _SetStylo1
        POP    {R4,PC}
        
Estilo2:
        BL _SetStylo2
        POP    {R4,PC}
        
Estilo3:
        BL _SetStylo3
        POP    {R4,PC}
        
Estilo4:
        BL _SetStylo4
        POP    {R4,PC}
                     nop
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...
        BL    _SetChecked
        LDR    R0, [R4,0x18]
        LDR    R2, _OneOfMany_SetChecked
...
;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
_SetChecked:    
        PUSH    {R0,R2-R7,LR}
        MOV    R0, 0
        PUSH    {R0}
        adr    R1, afile_bin
        ldr    R0, aTpaPresetSys
        MOV    R2, 1
        MOV    R3, 0xFF
        ADD    R3, 0x81
        PUSH    {R3}
        LDR    R3, __fopen
        MOV    R12, R3
        POP    {R3}
        BLX    R12
        ADD    R4, R0,    0
        MOV    R2, 1
        MOV    R1, SP
        LDR    R3, _fread
        BLX    R3
        ADD    R0, R4,    0
        LDR    R1, _fclose
        BLX    R1
        LDR    R1, [SP]
        ADD    SP, SP,    4
        POP    {R0,R2-R7,PC}

aTpaPresetSys    du    "/tpa/preset/system/",0 
afile_bin du "file.bin",0


 den_po:
07.08.11, 22:21
 albertnet3, once again: don't you realise what does the name of this gui mean?

 Evil-Racer:
17.08.11, 21:52
 Эмм... Мож и глупый вопрос... Но...
BOOK* top_book = Display_GetTopBook(0);
Теперь, я получил верхнюю буку, как узнать что это, ява или просто бука? В исходниках от БМ есть кусок кода что то на подобие этого (пишу по памяти)
if (strcmp(top_book->xbook->name, JAVA_BOOK_NAME))
{...}
else
{...
mbk->isJava = TRUE;}
Но почему то у меня имя топ бука не CUIDisplayableBook а имя приложения (к примеру BombusMod), по этому isJava у меня всегда ложь. В общем... Что делать?

 den_po:
18.08.11, 01:20
 ещё раз напоминаю: патч для IAR позволит избежать кучи проблем. ссылка в первом сообщении.


Evil-Racer, смотри GetJavaName

 Karasyov:
18.08.11, 14:01
 Подскажите, а как можно сделать, чтобы была возможность менять язык через конфиг?

 IronMaster:
18.08.11, 14:25
 Karasyov,
кто мешает добавить опцию в бцфг, а в самом эльфе проверять и подсовывать соответствующие строки??
Страница 186 из 211: « 1 ... 182 183 184 185 [186] 187 188 189 190 ... 211 »

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

© 2005-2018 supertrubka.org