On Sun, 05 Dec 2010 10:45:38 +0000 (GMT) 김재환 <jae.hwan....@samsung.com> said:

> 
> Hello,
> 
> We made group title in genlist. 
> And the API "elm_genlist_item_append_with_group" is used when item is
> appended in group. But I want to use the same API when normal item, child
> item and the member item of the group are appended. So I changed the code of
> the API "elm_genlist_item_append" such as following psuedo-code. Please
> review and advise.

what you propose is much more sensible -in fact it should have been done this
way with an item flag to begin with.

==============================================================================================================================
> elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc,
>                         const void *data, Elm_Genlist_Item *parent,
>                         Elm_Genlist_Item_Flags flags,
>                         Evas_Smart_Cb func, const void *func_data)
> {
>    ...
>    if (!it->parent)
>      {
>           append normal item
>      }
>    else
>      {
>         if(it->parent->type == ELM_GENLIST_ITEM_TYPE_ITEM)
>           {
>                 append child item of the parent
>           }
>         else if(it->parent->type == ELM_GENLIST_ITEM_TYPE_GROUP)
>           {
>                 append member item of the parent(group)
>           }
>      }
>      ...
>      return it;
> }
> ==============================================================================================================================
> 
> If the upper psuedo-code don't have the issue, please review the another
> psuedo-code about the API "elm_genlist_item_insert_before". The following is
> it. But it has a issue.
> In case of "insert", there is not the parameter of the parent.
> So I set the parent of the given item"before" to the parent of the new item.
> As a result, child item and member item of the group can be inserted before
> the given item "before" But I don't know how to do, If "before" has the parent
> (parent is group) and I want to insert the normal item(not child item or
> member item of the group) before the given item "before". In other words, If
> "before" has the parent, new item will have the parent and it should be one
> of the two(child item or member item). If "before" has the parent, the new
> item can't become normal item.

ok. i see your problem.

let's say you have the following:

a
b
c
HEAD1
  x
  y
  z
HEAD2
  i
  j
  k
  HEAD3
    f
    g
    h
  HEAD4
    l
    m
    n
  HEAD5
    o 
    p
    q
HEAD5
  r
  s
  t
u
v
w

as such i actually can't see a way to build that with anything other than
append and prepend. insert before/after wont do what you want. if i had to add
HEAD4+ l,m,n in that wasn't there to start with, i couldn't actually do it
without rebuilding. it would require that insert before/after gets a parent
param. i see no way around that. and so... that means the api has to break.

> Please think about this issue.
> 
> ==============================================================================================================================
> EAPI Elm_Genlist_Item *
> elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class
> *itc, const void *data, Elm_Genlist_Item *before,
>                                Elm_Genlist_Item_Flags flags,
>                                Evas_Smart_Cb func, const void *func_data)
> {
>    ...
>    Set before->parent to  it->parent
>    if (!it->parent)
>       insert nomal item before the given item "before".
>    else
>      {
>         if(it->parent->type == ELM_GENLIST_ITEM_TYPE_ITEM)
>           {
>               insert child item of the parent before the given item "before".
>           }
>         else if(it->parent->type == ELM_GENLIST_ITEM_TYPE_GROUP)
>           {
>               insert member item of the parent(group) before the given item
> "before". }
>      }
>    ...
>    return it;
> }
> ==============================================================================================================================
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly 
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus 
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to